add try/except to computer prompt, invalid input should not crash game

This commit is contained in:
Marc Wilson
2022-09-03 09:38:19 -07:00
parent 520c0c190e
commit 007b38751d

View File

@@ -902,7 +902,10 @@ class Game:
if len(command) == 0:
com = 6
else:
try:
com = int(command)
except ValueError:
com = 6
if com < 0:
return