Skip to content

tsuromapmaker bug  #7

Description

@AllegroGavin

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions