Jonathan. Frech’s WebBlog

c’t-Racetrack (#74)

Jonathan Frech,

In a recent c’t article⁠¹ they showed a game re­gard­ing vector mathematics, velocities, accelerations and positions.
I could not resist and wrote this pro­gram to simulate the game.
The on­ly thing this pro­gram cannot do is to check the barriers. That you have to check for yourself.

The Game

You have a start position (red), an end position (green) and some barriers (white).
Your job is it to steer your little dot (bright yellow) onto the end position.
To make it more difficult, you are not allowed to change the dot’s position di­rect­ly, but rather you accelerate it on each step.
Your ac­cel­er­a­tion vector (turquoise) also is not allowed to be longer than 10 (dim yellow bubble) and at the end point your dot must have a velocity of (0, 0).

The fewer moves you need, the better your steering abilities.

Controls

Source code: ct-racetrack.py


[1][2020-10-24] For the list of all submitted entries, see here.