Added automove option which is on by default. Added helpful hints for invalid options.

This commit is contained in:
Patrick Marsee 2020-05-10 23:54:48 -04:00
parent 4a398cc2a3
commit 871646fccc

View file

@ -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 = []