Merge pull request #794 from posguy99/superstartrek_python_fix

add try/except to computer prompt, invalid input should not crash game
This commit is contained in:
Jeff Atwood
2022-09-03 10:06:49 -07:00
committed by GitHub

View File

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