Question 6(b)(i) 2016 · May-June · Paper 41 · 4 marks
Reveal official mark-scheme answer




Official answer for Question 6
Part (b)
(i)
Part (b)
(i)
Question 4
Show text version of question
Question 6
Part (b)
(i)
Question 6
In a board game, one player has white pieces and the other player has black pieces. Players take alternate turns to move one of their pieces. White always makes the first move. The game ends if: • a player is unable to make a move when it is their turn. In this case, there is no winner. This is called ‘stalemate’. • a player wins the game as a result of their last move and is called a ‘winner’.
Part (b)
The layout of the board at the start of the game is shown below:
x y
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 15
The programmer decides to use a 2D array to represent the board. The index numbering to be used is as shown. Each square on the board is either occupied by one piece only, or is empty. The data stored in the array indicate whether or not that square is occupied, and if so, with a black piece or a white piece.
(i)
Write program code to initialise the contents of the array to represent the board at the start of the game. Use characters as follows for each square: 'B' represents a black piece 'W' represents a white piece 'E' represents an empty square Visual Basic and Pascal: You should include the declaration statements for variables. Python: You should show a comment statement for each variable used with its data type. Programming language ..................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... ........................................................................................................................................... .......................................................................................................................................[4]
Question 16
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 9608_s16_qp_41.pdf
