int oppenentXCheckpoint = opponentX-nextCheckpointX;
int oppenentYCheckpoint = opponentY-nextCheckpointY;
int opponentCheckpointDist =(int)Math.sqrt(oppenentXCheckpointoppenentXCheckpoint+oppenentYCheckpointoppenentYCheckpoint);
Hello, Iām struggling in the bronze league, can someone help me, I canāt get through! Here is my current code:
import sys
import math
Auto-generated code below aims at helping you parse
the standard input according to the problem statement.
use = False
game loop
while True:
# next_checkpoint_x: x position of the next check point
# next_checkpoint_y: y position of the next check point
# next_checkpoint_dist: distance to the next checkpoint
# next_checkpoint_angle: angle between your pod orientation and the direction of the next checkpoint
x, y, next_checkpoint_x, next_checkpoint_y, next_checkpoint_dist, next_checkpoint_angle = [int(i) for i in input().split()]
opponent_x, opponent_y = [int(i) for i in input().split()]
# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr, flush=True)
radian = math.radians(next_checkpoint_angle)
puissance=math.cos(radian)
puissance=int(puissance*100)
#if next_checkpoint_dist<=1000 :
# puissance = 0
if puissance<0 :
puissance = 0
# You have to output the target position
# followed by the power (0 <= thrust <= 100)
# i.e.: "x y thrust"
if next_checkpoint_angle == 0 and use == False and next_checkpoint_dist>=4000:
print(next_checkpoint_x,next_checkpoint_y,"BOOST")
use = True
else :
print(next_checkpoint_x,next_checkpoint_y,puissance)
So I managed to hit Silver without any AI algorithms. Is it normal that I hit a wall in order to get to Gold, and I have to start using other, better algorithms? I see the assignment specifically says āgenetic programmingā. Was the idea to use something like that from the beginning?
I could really use some pointers here! This is all new for me.