Sample question (on the hard side)

You are to write an interpreter for a small robot control language. The robot starts at position (0,0) of an infinite grid. The basic commands of the robot control language are simple moves which intruct the robot to move North, East, South or West. This is represent in Ocaml as:
type move = N | E | S | W 
If a robot is at position (x,y) then a command N moves it to position (x+1,y), a command E moves it to position (x,y+1), and so on.

Final solution