Advertisement
Guest User

CSB

a guest
Oct 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. import sys
  2. import math
  3.  
  4. # game loop
  5. while True:
  6.    
  7.     x, y, next_checkpoint_x, next_checkpoint_y, next_checkpoint_dist, next_checkpoint_angle = [int(i) for i in input().split()]
  8.     opponent_x, opponent_y = [int(i) for i in input().split()]
  9.  
  10.    #distance
  11.    # The checkpoints are circular, with a radius of 600 units.
  12.     if next_checkpoint_dist < 650:
  13.         thrust =8
  14.     else:
  15.         thrust = 100
  16.    
  17.     #angle
  18.     if next_checkpoint_angle > 90 or next_checkpoint_angle < -90:
  19.         thrust = 0
  20.     if next_checkpoint_angle > 45 or next_checkpoint_angle < -45:
  21.         thrust = 25
  22.     if next_checkpoint_angle > 20 or next_checkpoint_angle < -20:
  23.         thrust = 10
  24.     #boost when checkpoint distance is 7000 and angle is 0
  25.     if next_checkpoint_dist > 7000 and next_checkpoint_angle == 0: #( -5 < next_checkpoint_angle < 5):
  26.         thrust = "BOOST"
  27.    
  28.     #shield
  29.     #if next_checkpoint_dist < 500 and next_checkpoint_angle < 35:
  30.      #   thrust = "SHIELD"
  31.        
  32.     print(str(next_checkpoint_x) + " " + str(next_checkpoint_y) + " " + str(thrust))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement