Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import defaultdict
- players = input().split(", ")
- size = 6
- board = []
- for _ in range(size):
- current_row = input().split()
- board.append(current_row)
- condition = defaultdict(bool)
- while True:
- player = players[0]
- row, col = eval(input())
- if condition[player] == True:
- condition[player] = False
- players.pop(0)
- players.append(player)
- continue
- if board[row][col] == "E":
- print(f"{player} found the Exit and wins the game!")
- break
- if board[row][col] == "T":
- print(f"{player} is out of the game! The winner is {players[1]}.")
- break
- if board[row][col] == "W":
- print(f"{player} hits a wall and needs to rest.")
- condition[player] = True
- players.pop(0)
- players.append(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement