mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Update tower.py
easier debugging with fewer disks
This commit is contained in:
@@ -60,7 +60,10 @@ GOOD LUCK!
|
|||||||
|
|
||||||
class Game:
|
class Game:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__sizes = [3, 5, 7] # ,9,11,13,15]
|
# use fewer sizes to make debugging easier
|
||||||
|
# self.__sizes = [3, 5, 7] # ,9,11,13,15]
|
||||||
|
self.__sizes = [3, 5, 7, 9, 11, 13, 15]
|
||||||
|
|
||||||
self.__sizes.sort()
|
self.__sizes.sort()
|
||||||
|
|
||||||
self.__towers = []
|
self.__towers = []
|
||||||
@@ -156,4 +159,4 @@ while True:
|
|||||||
print("'YES' OR 'NO' PLEASE\n")
|
print("'YES' OR 'NO' PLEASE\n")
|
||||||
elif game.moves() > 128:
|
elif game.moves() > 128:
|
||||||
print("SORRY, BUT I HAVE ORDERS TO STOP IF YOU MAKE MORE THAN 128 MOVES.")
|
print("SORRY, BUT I HAVE ORDERS TO STOP IF YOU MAKE MORE THAN 128 MOVES.")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user