mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-07-11 22:51:35 -07:00
BUG: Hangman (Python) had a List-vs-Str comparison
MAINT: Add type annotations to find such issues
This commit is contained in:
@@ -24,7 +24,7 @@ import random
|
||||
|
||||
|
||||
def main() -> None:
|
||||
WORDS = [
|
||||
words = [
|
||||
[
|
||||
"Ability",
|
||||
"Basal",
|
||||
@@ -85,7 +85,7 @@ def main() -> None:
|
||||
still_running = True
|
||||
while still_running:
|
||||
phrase = ""
|
||||
for section in WORDS:
|
||||
for section in words:
|
||||
if len(phrase) > 0:
|
||||
phrase += " "
|
||||
phrase += section[random.randint(0, len(section) - 1)]
|
||||
|
||||
Reference in New Issue
Block a user