Professional Documents
Culture Documents
Debugging Algorithms
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.
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
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°
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
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.
Debugged Debugged
Directions Directions
Directions Directions
Debugged
Directions
Directions
visit twinkl.com