viligen

ball_in_bucket

Jan 27th, 2022 (edited)
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. size = 6
  2. matrix = []
  3. score = 0
  4.  
  5. for row in range(size):
  6.     matrix.append(input().split())
  7.  
  8.  
  9. for _ in range(3):
  10.     line = input().split(', ')
  11.     throw_row, throw_col = int(line[0][1]), int(line[1][0])
  12.     if throw_row not in range(size) or throw_col not in range(size):
  13.         continue
  14.     if matrix[throw_row][throw_col] == "B":
  15.         matrix[throw_row][throw_col] = '0'
  16.         for r in range(size):
  17.             score += int(matrix[r][throw_col])
  18.  
  19. prize = ''
  20.  
  21. if score < 100:
  22.     print(f"Sorry! You need {100 - score} points more to win a prize.")
  23. elif score < 200:
  24.     prize = 'Football'
  25. elif score < 300:
  26.     prize = 'Teddy Bear'
  27. else:
  28.     prize = 'Lego Construction Set'
  29.  
  30. if prize:
  31.     print(f"Good job! You scored {score} points, and you've won {prize}.")
  32.  
  33.  
Add Comment
Please, Sign In to add comment