Advertisement
Guest User

Untitled

a guest
Apr 7th, 2021
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. import sys
  2. import math
  3.  
  4. # Drop chips in the columns.
  5. # Connect at least 4 of your chips in any direction to win.
  6.  
  7. # my_id: 0 or 1 (Player 0 plays first)
  8. # opp_id: if your index is 0, this will be 1, and vice versa
  9. my_id, opp_id = [int(i) for i in input().split()]
  10.  
  11. # game loop
  12. while True:
  13. turn_index = int(input()) # starts from 0; As the game progresses, first player gets [0,2,4,...] and second player gets [1,3,5,...]
  14. for i in range(7):
  15. board_row = input() # one row of the board (from top to bottom)
  16. num_valid_actions = int(input()) # number of unfilled columns in the board
  17. for i in range(num_valid_actions):
  18. action = int(input()) # a valid column index into which a chip can be dropped
  19. opp_previous_action = int(input()) # opponent's previous chosen column index (will be -1 for first player in the first turn)
  20.  
  21. # Write an action using print
  22. # To debug: print("Debug messages...", file=sys.stderr, flush=True)
  23. if(my_id==1):
  24. print("STEAL")
  25. if(turn_index<64):
  26. x=-1
  27. x2=x+1
  28. print(x2)
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement