Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
Question 10

A robot is placed in a 5x5 grid. The robot's starting position is shown in the grid below by the arrow symbol ▲ at Row 3, Column 3, which indicates it is initially facing North (Up).

Black squares containing an [Obstacle] cannot be moved into.

Robot Grid

Row / ColColumn 1Column 2Column 3Column 4Column 5
Row 1
Row 2[Obstacle][Obstacle]
Row 3[Obstacle]▲ (Start)[Obstacle]
Row 4
Row 5

Robot Algorithm

WHILE ObjectAhead() = true
  TurnRight()
  IF ObjectAhead() = true THEN
    TurnLeft()
    TurnLeft()
  ENDIF
  Forward(1)
ENDWHILE
Forward(1)

Determine the sequential path of coordinates the robot visits from start to finish. Specify each step in order using the format (Row, Column).

[3]
Markscheme

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms

208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank