CONGRATULATIONS to @kuroineko. Wins the bounty for excellent speed (672 moves) on the Gauntlet track.
LEADER:* Nimi scoring a lightweight 2129. Other entries are larger but showing some serious speed.
*Leader may change due to later entries.
Your task is to write a small program that can drive a racing car fast.
Your program will read in an image of the track. You can start your car on any yellow pixel, and you must finish by crossing any black pixel. The path of your car must be only on the grey ((c,c,c) where 30 <= c <= 220) track.
Your car will move in a straight line each turn with velocity v made up of integers vx and vy (starting with (0,0)). At the start of each turn your program can change vx and vy such that:
abs(vx2-vx1) + abs(vy2-vy1) <= 15
Update: Increased maximum acceleration to 15.
Your program will then plot a straight line from your current location to (location + v) in white with a blue dot at the start. If a pixel under this line is black, you have finished the race. Otherwise, if all the pixels under that line are grey or yellow, you may continue to the next turn.
Your program must output the track image with your path in white and blue added.
Additional Output (added 2015-01-15):
If you wish to compete for the win or the bonus, your program should also output your list of points (the blue dots) for the City or Gauntlet respectively. Include the list of points with your answer (for verification). The points should look like:
(x0,y0), (x1,y1), ... (xn,yn). You can use white space freely including
'\n' characters to fit the data on the page.
You may use third party image reading and writing, line drawing and pixel access libraries. You can't use path-finding libraries. If you wish you can convert the PNG images into other graphics formats (such as GIF, JPG, BMP) if you need to.
A few tracks to drive on
A simple track to start out:
A Race Track:
An Obstacle Course:
Nightmare Track: The Gauntlet (if the others are too easy)
Your score will be based on your result on the City track. Points are equal to your program length in bytes plus 10 points for each turn your racing car took to finish. Lowest score wins. Please include your City track run image with your answer - we would like to see your driving style.
Please use a title for your answer in the format:
<Racing Driver or Team Name> <Language> <Score> eg: Slowpoke Perl 5329
Your program must be able to drive on any track image following the above rules. You must not hardcode the optimum path or any parameters of the test tracks. The other standard loopholes apply.
This is a similar puzzle to one posed by Martin: To Vectory! – The Vector Racing Grand Prix. This puzzle has a number of differences:
- Driving through walls is not allowed.
- You can use unlimited memory and time.
- You do not have to run somebody else's code on your computer.
- You do not have to download anything except one image.
- The size of your code counts in scoring. Smaller is better.
- You plot your solution on the track image.
- You can easily create your own tracks with a paint package.
- The higher resolution encourages more realistic braking and cornering.
- Acceleration of 15 creates about 450 possibilities per turn. This makes BFS less feasible and encourages new interesting algorithms.
This puzzle should inspire a new round of programmers to try solutions and allow programmers with old solutions to rethink them in the new environment.