asweigart / asweigart/PythonStdioGames

tsuromapmaker bug

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
971
Forks
216
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.