Warmup - Red Rover

You met a child, who due to physical disability, is unable to play red rover with his friends. Having seen his great despair, you decided to make a robot that the child can control and thus take part in the game with his friends. Your goal is to get the robot built and running before the child's birthday, which is tomorrow!

You worked all night long, and with Tony Stark's help, you successfully built the robot. With 15 minutes to spare, prior to leaving for the birthday party, you realize that you still need to build the module to run the robot. Quickly, review the requirements for the game and build out the module. Hurry, you don't want to be late!

Requirements:

  • The user can choose a number between 0 and 5.
  • After the user chooses a number it will check to see who is at that position in the line and the person to their left and calculate the average of their combined strength. If their average strength is less than the robot's strength then the robot will break the link and join the line.
  • The first time the robot successfully joins the line, congratulate the young child and return "You win!" if that should happen, else you must return an uplifting message that encourages the user to try again.