You are on page 1of 6

Treasure Hunt Unplugged Activity

Debugging Algorithms

path tile necklace treasure chest crown

lava tile gold coins diamond pile of treasure

boulder skull Egyptian artefact

explorer/start emerald ruby

visit twinkl.com
Treasure Hunt Unplugged Activity
Debugging Algorithms
Directions are an example of an algorithm. An algorithm is a set of instructions written in order
or sequence. Look carefully at the directions below. There is at least one error in each set of
directions. The error is shown in red. Debug the algorithm by writing the directions correctly.

Directions to the Ruby Directions to the Treasure Chest

Debugged Debugged
Directions Directions
Directions Directions
Forward 3
Forward 3 Right 90°
Right 90° Forward 1
Forward 2 Right 90°
Left 90° Forward 1
Forward 4 Left 90°
Forward 3

Directions to the Egyption Artefact

Directions Debugged Directions

Forward 3
Right 90°
Forward 1
Left 90°
Forward 2
Right 90°
Forward 5
Right 90°
Forward 1

visit twinkl.com
Treasure Hunt Unplugged Activity
Debugging Algorithms Answers
Directions to the Ruby Directions to the Treasure Chest

Debugged Debugged
Directions Directions
Directions Directions
Forward 3 Forward 3
Forward 3 Forward 3
Right 90° Right 90°
Right 90° Right 90° Forward 1 Forward 2
Forward 2 Forward 1 Right 90° Right 90°

Left 90° Left 90° Forward 1 Forward 1


Left 90° Left 90°
Forward 4 Forward 4
Forward 3 Forward 3

Directions to the Egyption Artefact

Directions Debugged Directions

Forward 3 Forward 3
Right 90° Right 90°
Forward 1 Forward 1
Left 90° Left 90°
Forward 2 Forward 3
Right 90° Right 90°
Forward 5 Forward 5
Right 90° Left 90°
Forward 1 Forward 1

visit twinkl.com
Treasure Hunt Unplugged Activity
Debugging Algorithms
Directions are an example of an algorithm. An algorithm is a set of instructions written in
order or sequence. Look carefully at the directions below. There is at least one error in each set
of directions. Spot the error and debug the algorithm by writing the directions correctly.
Directions to the Crown Directions to the Necklace

Debugged Debugged
Directions Directions
Directions Directions

Forward 3
Forward 3
Right 90°
Right 90°
Forward 2
Forward 2
Left 90°
Right 90°
Forward 1
Forward 1
Right 90°
Left 90°
Forward 2
Forward 2
Left 90°
Left 90°
Forward 2
Forward 1
Directions to the Diamond Right 90°
Forward 3
Debugged
Directions Right 90°
Directions
Forward 4
Forward 3
Left 90°
Right 90°
Forward 1
Forward 2
Right 90°
Left 90°
Forward 1 Forward 2
Right 90° Left 90°
Forward 4 Forward 1
Right 90°
Forward 1
Left 90°
Forward 3
Left 90°
Forward 2

visit twinkl.com
Treasure Hunt Unplugged Activity
Debugging Algorithms Answers
Directions to the Crown Directions to the Necklace

Debugged Debugged
Directions Directions
Directions Directions

Forward 3 Forward 3
Forward 3 Forward 3
Right 90° Right 90°
Right 90° Right 90°
Forward 2 Forward 2
Forward 2 Forward 2
Left 90° Left 90°
Right 90° Right 90°
Forward 1 Forward 3
Forward 1 Forward 1
Right 90° Right 90°
Left 90° Left 90°
Forward 2 Forward 2
Forward 2 Forward 2
Left 90° Left 90°
Left 90° Left 90°
Forward 2 Forward 2
Forward 1 Forward 1
Right 90° Right 90°
Directions to the Diamond Forward 3 Forward 2
Debugged Right 90° Right 90°
Directions
Directions Forward 4 Forward 1

Forward 3 Forward 3 Left 90° Left 90°


Right 90° Right 90° Forward 1 Forward 1
Forward 2 Forward 2 Right 90° Right 90°
Left 90° Left 90° Forward 2 Forward 2
Forward 1 Forward 3 Left 90° Left 90°
Right 90° Right 90° Forward 1 Forward 1
Forward 4 Forward 4
Right 90° Right 90°
Forward 1 Forward 1
Left 90° Left 90°
Forward 3 Forward 2
Left 90° Left 90°
Forward 2 Forward 2

visit twinkl.com
Treasure Hunt Unplugged Activity
Debugging Algorithms
Directions are an example of an algorithm. An algorithm is a set of instructions written in
order or sequence. Write directions to tell someone how to reach the following items within
the hidden tomb. Include an error (or errors) in the directions. Challenge a partner to find the
error (or errors) and debug the algorithm by writing the directions correctly.

Directions to the Emerald Directions to the Pile of Treasure

Debugged Debugged
Directions Directions
Directions Directions

Directions to the Gold Coins

Debugged
Directions
Directions

visit twinkl.com

You might also like