Added automove option which is on by default. Added helpful hints for invalid options.
This commit is contained in:
parent
4a398cc2a3
commit
871646fccc
1 changed files with 21 additions and 3 deletions
24
gameshell.py
24
gameshell.py
|
@ -73,9 +73,27 @@ class GameShell(Shell):
|
|||
while i < len(args):
|
||||
if args[i] == 'color':
|
||||
i += 1
|
||||
if args[i] in ('0', '3', '4', '8', '24'):
|
||||
self.colorMode = int(args[i])
|
||||
i += 1
|
||||
if len(args) > i:
|
||||
if args[i] in ('0', '3', '4', '8', '24'):
|
||||
self.colorMode = int(args[i])
|
||||
i += 1
|
||||
else:
|
||||
print("Valid color depths are 0, 3, 4, 8, and 24.")
|
||||
else:
|
||||
print("Valid color depths are 0, 3, 4, 8, and 24.")
|
||||
elif args[i] == 'automove':
|
||||
i += 1
|
||||
if len(args) > i:
|
||||
if args[i] in ('on', 'off'):
|
||||
self.gameBase.autoMove = args[i] == 'on'
|
||||
i += 1
|
||||
else:
|
||||
print("Valid options are 'on' and 'off'.")
|
||||
else:
|
||||
print("Valid options are 'on' and 'off'.")
|
||||
else:
|
||||
print("Could not identify option {}".format(args[i]))
|
||||
i += 1
|
||||
|
||||
def __colorTestRoutine(self, lower, upper):
|
||||
colors = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue