summaryrefslogtreecommitdiff
path: root/integer_sum_from_neighbours/neighborsum-to-latex.py
diff options
context:
space:
mode:
Diffstat (limited to 'integer_sum_from_neighbours/neighborsum-to-latex.py')
-rwxr-xr-xinteger_sum_from_neighbours/neighborsum-to-latex.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/integer_sum_from_neighbours/neighborsum-to-latex.py b/integer_sum_from_neighbours/neighborsum-to-latex.py
index a920d9d..3fb3daa 100755
--- a/integer_sum_from_neighbours/neighborsum-to-latex.py
+++ b/integer_sum_from_neighbours/neighborsum-to-latex.py
@@ -34,6 +34,9 @@ for i, cells in enumerate(matrix):
# Found changed cell!
changedCells.append(col)
break
+ else:
+ # Should not happen! Something got stuck?
+ changedCells.append(None)
line = " "
for col in range(len(matrix[0])):
@@ -50,4 +53,6 @@ for step, cells in enumerate(matrix):
else:
line += " & %5d" % value
line += r" \\"
+ if step > 0 and changedCells[step] is None:
+ line += " % unchanged!"
print(line)