I do 3, 6 or 9 moves per pod, -18/0/18 with 0/200/SHIELD. Shield moves are only added if the 0 speed moves involve collisions and thrust moves aren’t included if the shield timeout is active.
For a single pair that means you need (assuming avg of 6 choices per turn) 36/1296/46656/1679616 simulated turns for depth 1/2/3/4 (each involves a move for both players as it is simultaneous) so depth 3 is doable without any pruning. The usual minimax improvements (Alphabeta, move ordering) then reduce the required simulation count and I pretty much always get depth 4 for both pods, often getting 5 for one pair and occasionally 5 for both.
You wouldn’t want to include boost within that loop as you should be taking in the distance to the next checkpoint as well as angle when considering boosting, you may want to consider something like
In terms of actually racing, you want to be able to adjust the destination of your pod based on your speed, allowing it to target a closer section of the actual point radius based on speed(the radius of the point is 600)
(nextCheckpointX-VelocityX) for example
How i am supposed to do anything when i new and i want to LEARN one language, not to show my skills?! And then i see sigh “Can you fix the code?” NO, i can’t , what is this "Educational site " when after one hour i don’t want to touch codes again in my life? Huh?
Hi, I am new to codingame but I cannot get passed the tutorial of this. It keeps saying error because I don’t have the right coordinates. I am using python. The following is my code.
import sys
import math
# This code automatically collects game data in an infinite loop.
# It uses the standard input to place data into the game variables such as x and y.
# YOU DO NOT NEED TO MODIFY THE INITIALIZATION OF THE GAME VARIABLES.
# game loop
while True:
# x: x position of your pod
# y: y position of your pod
# next_checkpoint_x: x position of the next check point
# next_checkpoint_y: y position of the next check point
x, y, next_checkpoint_x, next_checkpoint_y = [int(i) for i in input().split()]
# Write an action using print
# To debug: print("Debug messages...", file=sys.stderr)
# Edit this line to output the target position
# and thrust (0 <= thrust <= 100)
# i.e.: "x y thrust"
print(str(next_checkpoint_y) + " " + str(next_checkpoint_y) + " 50")
How do i get boost while using Python? I have tried a lot of ways but it never works. Including the solutions given from above.
This is my code for when printing:
import sys
import math
while True:
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()]
if next_checkpoint_angle>90 or next_checkpoint_angle<-90 or
next_checkpoint_dist<1500:
thrust = 0
else:
thrust = 100
if next_checkpoint_dist > 5000:
print(str(next_checkpoint_x-20) + " " + str(next_checkpoint_y-20) + " " + "BOOST"))
else:
print(str(next_checkpoint_x-20) + " " + str(next_checkpoint_y-20) + " " + str(thrust))
The Statement for boost looks fine, since to use Boost, it’s just the string display of BOOST
have you tried a smaller next checkpoint distance?, so that you can test to see if it works in the IDE
I was able to figure it out. I made a different condition so that if it was greater than a certain dist, it would set the var thrust to the string BOOST.
boostplayed = 0
while True
if boostplayed == 0 and next_checkpoint_dist >= 6000 and next_checkpoint_angle<10 and next_checkpoint_angle>-10:
boostplayed = 1
thrust = "BOOST"
print(str(next_checkpoint_x-20) + " " + str(next_checkpoint_y-20) + " " + str(thrust))
I’m just trying to understand how to progress from Wood 1 to whatever comes after (Wood 2???).
I managed to BOOST, like it says to in the description but the game never goes to the next part. Am I to assume then that I need to go above and beyond what is asked for in the puzzle and add a clause for there to be a certain distance from a checkpoint before the BOOST is used? Or is it bugged and its not progressing? I have to reach a certain rank when submitting my code and it does like 150 races?
Given you code, you print BOOST every turn.
Okay you’re in javascript, but your thrust is a int and then it’s a string. Make sure you understand what thrust is and what you should output.
You will be promoted to Bronze if your bot gets a better score than the boss after your submit.
You already passed wood2 if you’re in wood1