Previous Next

Test driven learning

In order to help you learn Javascript, I will give you some tests: you have to program Reeborg to accomplish specific tasks and Reeborg itself will tell you if you got it right or wrong.

Select the world Home 1. Notice how the bottom left square is coloured differently: this is Reeborg's home. Reeborg's world is a simple grid. In Home 1, Reeborg starts at the third square on the bottom row. It labels this square as x=3 and y=1, using what is known as Cartesian coordinates.

In the Code editor, there is a program with a single command: move();. Try running the program and see what Reeborg has to say about the result.

Fix it!

Can you add a second line to the program so that Reeborg can go home?

Try two more

Select Home 2. Notice how Reeborg is in a different location and is also facing you. Try running the exact same program and see what happens.

Next, select Home 3. Notice how there is a small black square in the home position. Try to run your program now.

Previous Next