Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsuromapmaker bug #7

Open
AllegroGavin opened this issue Dec 14, 2019 · 0 comments
Open

tsuromapmaker bug #7

AllegroGavin opened this issue Dec 14, 2019 · 0 comments

Comments

@AllegroGavin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant