FHP Language Overview
FooBots are programmed in a language called FHP (pronounced "foop"). FHP is based on PHP, so it should be immediately familiar to many programmers. If you know how to do something in PHP, you already know how to do it in FHP. For anything you don't already know how to do, there are tons of PHP tutorials, sample programs, and code snippets on the web that can be directly applied to FHP with little or no change.
Here is a small sample of a FHP program:
variable $random, $direction;
$random=rand(0,1);
$direction=$random?'F':'R';
foo_drive($direction);
while (true)
  {
  foo_laser(foo_gettime()%2);
  }
All of the control structures from PHP (such as for-loops, if-then statements, switch-statements) are also available in FHP, as well as most of the standard functions PHP programmers are used to. Certain more exotic PHP structures and features which would be of no use for controlling bots have been omitted from FHP.
Keep in mind the following important differences from PHP:
Many customary PHP functions such as abs(), rand(), and substr() are also available in FHP. In addition there are many new functions which are used to control the bot or retrieve data from the bot's sensors. For a list of all available functions see the following link.
Complete List of FHP Functions