Mad Pod Racing - Puzzle Discussion

I understand,
I am just having trouble implementing the pseudocode into my input

i need the answer for Mad Pod Racing

Wood 2 League

The answer is in the statement.

what stat ment im not in a coding class im just tring to learn this

A pseudocode is in the puzzle statement to the left of the IDE. You may refer to that and convert it to the code in the programming language of your choice.

6 posts were merged into an existing topic: How do i learn from this website?

A post was merged into an existing topic: How do i learn from this website?

theres a history button, to see all your previous submissions

Can someone help me understand the movement of the pod? I’ve read these articles but I don’t quite understand it.

How do I calculate where my pod should go to make it turn properly? Many times it goes past the checkpoint because it is going too fast, I have tried to lower the speed when it is getting there but it doesn’t improve the results much either.

Thanks!

target a point near the checkpoint

i cant get past wood 2 i’m very new to coding i currently have what am i doing wrong??

game loop

while true; do
# nextCheckpointX: x position of the next check point
# nextCheckpointY: y position of the next check point
# nextCheckpointDist: distance to the next checkpoint
# nextCheckpointAngle: angle between your pod orientation and the direction of the next checkpoint
read -r x y nextCheckpointX nextCheckpointY nextCheckpointDist next_Checkpoint_Angle
read -r $opponent_X $opponent_Y

# Write an action using echo
# To debug: echo "Debug messages..." >&2

echo ${nextCheckpointX}" “${nextCheckpointY}” 100"
done
if next_Checkpoint_Angle< -100 or next_Checkpoint_Angle > 100
thrust = 0
else
thrust = 100
if nextCheckpointDist < 2000 then
thrust = 12
else
thrust = 100

  1. Are you using bash? I don’t think your syntax is right.
  2. Your logic flow is wrong. You output (echo) before you calculate the thrust, and the reverse should be done.
  3. Your echo always outputs thrust as 100. You have to replace the constant with a variable.

yes im using bash im very new

and how do i make it a variable?

I think you have to google it or learn it on another website, as this thread is for discussing Mad Pod Racing, instead of the syntax of any programming languages.

ok yes i see now sill question i made it a variable but i dont think i did it right now it says i didnt make a output and there was a error with my “else” on line 24 i dont understand it was working just fine now its not :confused:

while true; do
read -r x y nextCheckpointX nextCheckpointY nextCheckpointDist next_Checkpoint_Angle
read -r $opponent_X $opponent_Y
read -r thrust
echo “Debug messages…” >&2
echo ${nextCheckpointX}" “${nextCheckpointY}” 100"
if next_Checkpoint_Angle < -160 or next_Checkpoint_Angle > 200
thrust = 0
else
thrust = 97
end if
echo ${nextCheckpointX}" “${nextCheckpointY}” 100"
if nextCheckpointDist < 3000 then
thrust = 5
else
thrust = 97
end if
echo ${nextCheckpointX}" “${nextCheckpointY}” 100"
done

Your new code still suffers from the issues I mentioned in my earlier comment. You should consider learning how to write bash code on another website first, then coming back to CodinGame to practise.

ok thank you

just print x,y,thrust

how to finish mad pot racing level 3 using python 3?