Operation Right!

Your mission, should you decide to accept it, is to define a fruitful function named moveRight that has four parameters (inputs), representing a row, column, and two colors. Your function will return an integer (an updated column value). Your function should perform the following four steps:

  1. Invoke the function changeColor and supply three arguments (inputs): the row, column, and first color (a simple version of changeColor is provided for testing)
  2. Increase the value of column by one. If the value of column reaches 10, change it to 0
  3. Invoke the function changeColor again, and supply three arguments (inputs): the row, new value of column, and second color
  4. Return the new value of column

Write your function definition on the whiteboard set aside for your team. After your definition has been cleared by one of your mission leaders (Scott or Anna), implement and test your function as follows:

Operation Right

When your moveRight function is complete, six headers will appear below with row, column and color displayed for each call to the changeColor function (there are three calls to moveRight in the testing code, and this function calls changeColor twice)

When you're done, upload the code file to the MI6 folder in the public_html directory of the cs110d account. Your mission leaders will give you the password.