-
Notifications
You must be signed in to change notification settings - Fork 209
Open
Description
In the code:
This code uses checksums to make sure the above TILES were typed correctly.
for tile in enumerate(TILES):
assert len(tile) == 26, 'Tile %r has an incorrect length.' % (tile,)
total = 0
for i in range(25):
total += int(tile[i])
assert total % 10 == 0, 'Tile %r is wrong.' % (tile,)
TILES[i] = TILES[i][:25] # Cut off the checksum digit.
the index "i" used in the last line will always have the value 24, resulting in a length assert once it gets to that tile as it will have previously truncated it.
Metadata
Metadata
Assignees
Labels
No labels