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