From e13effbe754fabdced8601781e1ef2fc0b43d507 Mon Sep 17 00:00:00 2001 From: David Vereb Date: Tue, 7 Dec 2021 09:25:57 -0500 Subject: [PATCH] bugfix --- 2021/4/data | 1 + 2021/4/main.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/2021/4/data b/2021/4/data index ba441b7..25caf6c 100644 --- a/2021/4/data +++ b/2021/4/data @@ -599,3 +599,4 @@ 68 36 4 24 71 43 31 60 19 95 52 55 13 83 78 + diff --git a/2021/4/main.py b/2021/4/main.py index eb5937c..dcd7c6b 100644 --- a/2021/4/main.py +++ b/2021/4/main.py @@ -56,6 +56,9 @@ with open('data', 'r') as fp: else: # add the next array of numbers to the temporary board object temp_board.append(line.strip().split()) + if(len(temp_board)): + print('ERROR: You must have an empty line at the end of your data.') + exit() winning_number,winning_board_index = FindWinner(numbers) print('Winning Number:', winning_number, ', Winning Board Index: ', winning_board_index)