pile_sizes = [5] * 3 player_ID = 1 while True: print '-' * 20 print 'Player', player_ID, 'moves next' for i in range(3): print 'Pile', i+1, 'has', pile_sizes[i], 'stones' pile_ID = int(raw_input('Which pile to take from? ')) # Do input validation here: is pile_ID OK? stones_taken = int(raw_input('Take how many stones? ')) # Do input validation here: is stones_taken OK? pile_size[pile_ID] -= stones_taken # Here, add up all the pile_sizes, to get the total # of stones # Here, check if the game is over (there are zero stones left) # If so, tell the losing player the bad news # Here, switch player_ID. Clever, eh? player_ID = 3 - player_ID