Week 3 – Rich

Today, amongst other things, we discussed what pseudocode was and how important it was to use as a means to accurately describe what we want the robot to do before we write EV3 code.  The children discuss pseudocode, in a bit more detail, in their own posts.

The children looked at my EV3 code below, but it was not immediately obvious what the code did at all!  It would take a little time to follow it through and, if there was a block that was unfamiliar to them, they would need to research what it did before progressing to find the full intent of the code.However, by looking at the pseudocode I wrote before writing the EV3 code, the children quickly worked out exactly what the robot was meant to do and could relate it to the EV3 code.

1. Move forwards at a speed of 25
2. When the colour sensor detects a green or a red
     a. coast to a stop
3. Wait one second
4. If the colour is red:
     a. move backwards 240 degrees at a speed of 25
     b. turn right
5. If the colour is green:
     a. move backwards 240 degrees at a speed of 25
     b. turn left

Sometimes it’s useful to put the pseudocode in as a comment in your EV3 program, as below.

Use of pseudocode is something we will continue to develop as the childrens challenges become more complex 🙂

One thought on “Week 3 – Rich”

Comments are closed.