Reeborg Redux

Quick Overview of Day

Use JavaScript to solve a few Reeborg programming problems.

Warning

Although you can use Reeborg with JavaScript, the naming conventions of the built in functions and conditionals follow the underscore_naming_style (since it is primarily aimed at learning Python). Even though we will use camelCaseVariableNamingConvention for the rest of the course, you can use whatever you’d like for these practice problems.

Using JavaScript Mode

To solve the following practice problems, be sure to select JavaScript mode if it doesn’t happen automatically, as shown in the image below.

../_images/reeborg-js-mode.png

Step 9

Open Step 9 and write a JavaScript solution to pick up all flowers that appear, and put them all down in the 2,3 location, then move to the flag to finish the challenge. You will need to use two for loops, and one while loop. Your solution should look something like this:

../_images/step-9-demo.gif

Step 13

Open Step 13 and write a JavaScript solution to move to the flag, jumping over any hurdles that are in the way. Create a function called turnRight() as part of your solution. Remember that ! means NOT in JavaScript. Your solution should look something like this:

../_images/step-13-demo.gif

Step 16

Open Step 16 and write a JavaScript solution to pick up all of the carrots that might appear on the ground. Create a function called harvestColumn() as part of your solution. You will need to use three for loops and one while loop. Your solution should look something like this:

../_images/step-16-demo.gif