def convertNumberToString(num):
  # This function takes as input "num" between 1 and 5
  # and returns the corresponding string value "first",...
  ...
  ...

def turnLeftOrRight():
  # This function makes Scribbler turn left or right 
  # (chosen randomly) for a random duration between
  # 0 and 1 second
  ...
  ...

def main():
  record current values of time and battery
  while user wants to continue the random moves game:
    prompt user for maximum duration and read input
    prompt user for maximum number of stalls and read input
    while time still left and still have not reached maximum stalls:
      make robot move forward at full speed
      if stall occurs:
        update stall count
        speak message (need to convert stall count to string)
        move backwards
        randomly turn left or right
    generate dialog box for Continue? and obtain user choice
  print time and battery statistics