Learning Outcomes

Learning intention: how to use sequence to create algorithms.

  1. To convert an algorithm to a program.
  2. To regularly test and check the program.
  3. To use decomposition to test and trial the program when inputting.
  4. To debug any errors and modify/improve programs.


Let’s open our program again!

Edit Go back to https://replit.com, and log in.

Edit Press the menu icon:

Edit


Edit Select My repls:

Edit

Edit Then select your project:

Edit




Get ByteEd moving!

Once you have opened up your project, press the Edit button.

Do you notice ByteEd isn’t moving?

Edit

Let’s fix this and get ByteEd moving!

To achieve this, we need to tell ByteEd where to move. In other words, we need to give ByteEd directions to follow.

Remember earlier: if we wanted ByteEd to move down, down, left, left, then we used these instructions:

Edit

To specify this in Python, we need to write the following code:

Edit

Now try and run the program - what happens to ByteEd?

…It depends on where your land is!

What happens if you program ByteEd to walk into the water?

The water is an obstacle that ByteEd needs to avoid!

Edit

So now, complete the programming task to move ByteEd from the origin to the destination.

Make sure ByteEd does not go for a swim!

When ByteEd reaches the destination successfully, you’ll see this:

Edit



Edit Kua mutu? Finished?

Changing the origin and destination.

What happens when you change the origin for ByteEd?

What happens when you change the destination?

Practice writing algorithms and programs.