Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- players = input().split(", ")
- counter = 0
- points_to_win = 501
- matrix = []
- for row in range(7):
- matrix.append([el for el in input().split()])
- target = input()
- while target:
- for player in players:
- coordinates = target.split(", ")
- row1 = int((coordinates[0])[-1])
- col1 = int((coordinates[1])[0])
- if row1 and col1 in range(7):
- counter += 1
- points = int(matrix[row1][0]) + int(matrix[row1][6]) + int(matrix[0][col1]) + int(matrix[6][col1])
- if matrix[row1][col1] == "T":
- points_to_win -= (points * 3)
- if points_to_win <= 0:
- print(f"{player} won the game with {counter} throws!")
- break
- break
- elif matrix[row1][col1] == "D":
- points_to_win -= (points * 2)
- if points_to_win <= 0:
- print(f"{player} won the game with {counter} throws!")
- break
- break
- elif matrix[row1][col1] == "B":
- print(f"{player} won the game with {counter} throws!")
- break
- else:
- points_to_win -= int(matrix[row1][col1])
- if points_to_win <= 0:
- print(f"{player} won the game with {counter} throws!")
- break
- break
- target = input()
Add Comment
Please, Sign In to add comment