Mad Pod Racing - Puzzle Discussion

Hello guys,

I’m fresh new user of Coding Game, and a beginner in C language.

After few level of playing Mad Pod Racing, i start to modify my code to make a little bit efficient. And, first, i tried to use cos() function provided by math.h lib, and i get a time out, i didn’t found where the problem came. My first idea was that the program will not compile with the -lm flag. So i change my code.

Then, i just replaced my function using cos() with another one without extra libs provided by the game.
But i get the same time out, and executing directly by myself i got the right output.

Does someones got an idea or ressources so i can fix it by myself?
Below you can find my code:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#define ABS(x) (((x) < 0) ? -(x) : (x))
typedef struct race1{
    int x;
    int y;
    int next_checkpoint_x;
    int next_checkpoint_y;
    int next_checkpoint_dist;
    int next_checkpoint_angle;
    int opponent_x;
    int opponent_y;
}   t_position;

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/

int generate_speed(t_position p)
{
    double angle;
    double coef;
    int speed;

    angle = (double)ABS(p.next_checkpoint_angle);
    coef = 1.0 - (angle/90.0);
    speed = (int)(100.0 * (coef));
    if (speed <= 0)
        return (0);
    if (speed >= 100)
        return (100);
    return (speed);
}

int main()
{
    t_position *p;

    while (1) {
        scanf("%d%d%d%d%d%d", &p->x, &p->y, &p->next_checkpoint_x, &p->next_checkpoint_y, &p->next_checkpoint_dist, &p->next_checkpoint_angle);
        scanf("%d%d", &p->opponent_x, &p->opponent_y);
        
        // Write an action using printf(). DON'T FORGET THE TRAILING \n
        // To debug: fprintf(stderr, "Debug messages...\n");
        int speed;
        speed = generate_speed(*p);
        // You have to output the target position
        // followed by the power (0 <= thrust <= 100)
        // i.e.: "x y thrust"
        printf("%d %d %d\n", p->next_checkpoint_x, p->next_checkpoint_y, speed);
    }

    return 0;
}

There you can find the terminal output ingame:

Informations :
Timeout: the program did not provide 1 input lines in due time... KanticField will no longer be active in this game.
Sortie standard :
4524 6021 100
Informations :
Pod 1 of player Boss 3 moves towards (4524, 6021) at power 100

Thank you guys for reading me.

You never initialise p, so it’s a pointer to an undefined memory address.

I can’t seem to get a race to run… Is the site broken for everyone right now? Or is it just me?

Some players also reported an issue in Discord’s bug report channel.

Can someone please help me or give me some pointers as to how I can get into the Wood 1 league… I am currently in Wood 2 and I cannot beat this stupid bot no matter how hard I try… I am new to Python 3 (which is the language I am using) and I only have expirience in HTML/CSS which do not help at all here becuase they’re different.
I’m just looking for pointers or helpful hints so I can get past this stupid bot. I would include my code but it’s literally the default because I don’t know what to add to it, absolutely no clue whatsoever…
Thanks!

1 Like

You probably just need to convert the pseudo-code in the puzzle statement into Python and include that in your bot code to get into Wood 1.

im stuck on wood 2 using python and have absolutly no clue what im doing since the hint is in psuedo i dont know how to write it in python does anyone know where i can learn to do that?

Can anyone help me with the wood level 2, using C programming? even when thrust is at 100 i always come in second. when I’m watching the game play back, i sometimes go in front, sometimes I’m second, and then I end second. Every time. i don’t really know what to edit.

Please read the second last message above yours.

Hello!
im having trouble with boost as I tried a lot of options like: define or even just write … + “BOOST”
and it didn’t work. here is the example Coding Games and Programming Challenges to Code Better
(im using python)

We won’t see anything if you just link to the IDE. If necessary, please include a replay link instead.

To use boost, print it after the target coordinates plus a space, e.g.

print("5 1 BOOST")

ok thank you

Hello, is there a referee available for this puzzle?
Thanks.

Hi,
you can have a specific path in your program
here is an exemple
If ((Distance > N) AND (Angle < A) AND (IsBoostUsed != true)) then
printf(“%d %d BOOST\n”, next_checkpoint_x, next_checkpoint_y);
}

Hi all,
i’m thinking of a thing.
The theme is about IA… and neural network.
To use NN, we can implement code, but we have to train it. This means we have to store weight and bias somewhere to be reused.
how can we do this here?

1 Like

Please refer to the discussion here (part of the discussion is specific to Mad Pod Racing): https://www.codingame.com/forum/t/neural-network-ressources/1667

1 Like

Can you please help me understand what are the requirements to be able to challenge a friend?

Your genetic algorithm rules only the thrust and the angle. Did you use like generate by this algorithm, or you made some adaptation of the thrust after ?

WHY Am i unable to make ‘if’ statements with distance or anything? do i need to do some specifics to make it work? because i’m focusing on java, and when i’m good at coding, i will switch to python.
however, the only problem is that i want to try to clear this first, yet it won’t even budge a bit, not even with full thrust.

What messages does the console show?