Question 3(b)(i) 2015 · May-June · Paper 21 · 6 marks
Reveal official mark-scheme answer
Official answer for Question 3
Part (b)
(i)
Part (b)
(i)
WHILE NOT EOF(MessageText)
Show text version of question
Question 3
Part (b)
(i)
Question 3
A board game is designed for two players, O and X.
At the beginning, all cells of a 3 x 3 grid are empty.
The players take turns in placing their marker in an empty cell of the grid; player O always starts.
The game ends when one player completes a row, column or diagonal or the grid is full.
Here is one example after three turns:
O
O X
Ali wants to write a program to play the game. Ali decides to validate the player input.
The input is valid if:
- the row and column numbers are within the range 1 to 3 inclusive
- the cell is empty
Ali chooses a sequence of six pairs of integer values to simulate player input. The test starts with an empty grid.
(i)
Show the contents of the grid after the input of each pair of integer values. Circle whether
the input is valid or invalid. If the input is invalid state the reason.
Row Column Grid content Reason (if invalid) valid / invalid
2 2
valid / invalid
0 1
valid / invalid
1 1
valid / invalid
1 4
valid / invalid
4 1
valid / invalid
2 0
valid / invalid
2 2
Question 7
Why this question appears here
72% 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_s15_qp_21.pdf
