The 12th ICFP Programming Contest was about controlling a satellite (“Hohmann Transfer”); you would specify how fast you would like to accelerate in a direction, and could read some sensor to know where you (and other objects) are.
The first part of the contest required writing a “virtual machine”; then you need to figure out what the optimal accelerations are.
I decided to just convert the “binaries” into C; with one special feature:
The selection of the scenario is not done via the special port; i just used a simple parameter to the function, so the “in”-array is small.
I only added some code to calculate the current velocity and acceleration from two consecutive positions.