number of pieces a player has on the board.
Task 2
Amend the subroutine PrintResult to implement the formula given in the
information box above and output the score for each player and display the winner.
You must consider the possibility of a draw.
Task 3
• run the program
• enter Y
• load [Link]
Evidence that you need to provide
(i) Your PROGRAM SOURCE CODE for the entire subroutine.
CountNumberOfPieces and the entire subroutine PrintResult.
(9)
(ii) SCREEN CAPTURE(S) showing all the output from the requested test
including the board display.
(1)
(d) This question will further change the rules of the game.
When a piece is promoted to a dame, the player who the new dame belongs to now
chooses one of the opponent’s pieces. This piece is removed from the board and
the dame is placed in the square the removed piece was in.
(i) State the identifier of the data structure that now needs to be passed as a
parameter into the subroutine MoveDame.
(1)
What you need to do:
Task 1
Amend the subroutine MoveDame.
This subroutine is to:
• ask the player the piece ID of the opponent’s piece they want to remove
• check that the piece is an opponent’s piece and is on the board
• remove the opponent’s piece
• return the coordinates for the new dame.
Task 2
Amend the calls to MoveDame from within the subroutine MovePiece.
You will need to amend the parameter list of the subroutine heading of
MovePiece and the call to MovePiece from within the subroutine MakeMove.
Task 3
Test that the changes you have made work by conducting the following test:
• run the program
• enter Y
• load [Link]
Page 13 of 49
• move a2 to row 7, column 0
• take piece b1
Task 4
• move b5 to row 0, column 3
• take piece a6
Evidence that you need to provide
(ii) Your PROGRAM SOURCE CODE for the entire subroutine MoveDame and the
entire subroutine MakeMove.
(9)
(iii) SCREEN CAPTURE(S) showing the requested test including the board
display after piece b1 has been taken.
(1)
(iv) SCREEN CAPTURE(S) showing the requested test including the board
display after piece a6 has been taken.
(1)
(Total 29 marks)
Page 14 of 49