Past-paper question · 2016 May-June · Paper 11 · Q8(b)

Question 8(b) 2016 · May-June · Paper 11 · 2 marks

Original past-paper question for 8(B)
Original past-paper question for 8(B)
Reveal official mark-scheme answer Official mark-scheme answer for 8(B)

Official answer for Question 8

Part (b)

Part (b)

Description of the algorithm (or accept an algorithm):

[2]
✓
FOR Row ← 1 TO 7
✓
FOR Column ← 1 TO 7
✓
Board[Row, Column] ← -1 (or any value except 1 and 2)
✓
NEXT
✓
NEXT
✓
(1 mark for two nested loops …. or equivalent idea (e.g. description of loops)

Mark scheme 9691_s16_ms_11.pdf →

Show text version of question

Question 8

Part (b)

Question 8

Two players, X and O, play a game. The players take turns to place either ‘X’ or ‘O’ in any one of

the empty squares on the board. The board shows a current game in play.

1 2 3 4 5 6 7 1 X O 2 X 3 O

Question 4

5 O 6 X O O X 7 O X X X O

Either player (X or O) wins when there are four ‘X’s or four ‘O’s next to each other:

  • in a row, or
  • in a column, or
  • in a diagonal line
A
programmer is writing a computer program for the game.

The programmer stores the mark ‘X’ as the value 1 and the mark ‘O’ as the value 2.

The programmer uses a 2-dimensional array, Board[1 : 7, 1 : 7] , to store the current value in each square.

Part (b)

Describe how the programmer could initialise the array Board for the start of the game.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

[2]
Topic relevance

Why this question appears here

71% assigned-topic match · Hardware › Logic gates and logic circuits

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9691_s16_qp_11.pdf

Keep practising this topic