Question 8
AQA Computer Science November 2021 Paper 1 (7517/1)A level5 marks
On the specification
- 8.1
- 3.4 Theory of computation
- 8.2
- 3.2 Fundamentals of data structures
- 8.3
- 3.1 Fundamentals of programming
Question text
8 To specify which tile to use when entering a command, a player enters the index of the tile in the Tiles list. Instead of using this index the player could have been asked to enter the x, y and z coordinates for the tile. Figure 5 shows the coordinates and indices for each of the tiles in the default game. Figure 5 8.1 In the default game the tile with an index of 18 is in a straight line with the tile which has an index of 0. It is also in a straight line with the tile which has an index of 7 and in a straight line with the tile which has an index of 2. Explain how you can tell from the coordinates of two tiles if they are in a straight line with each other. [1 mark] 8.2 Figure 6 shows an incomplete calculation. Figure 6 GridSize × (difference between z and y coordinates) + 2 What should be replaced with so that the index of a tile in Tiles can be calculated from the coordinates of the tile? [2 marks] 8.3 Describe the modifications that would need to be made to the CheckMoveCommandFormat subroutine so that the move command could use coordinates instead of indices for the two tiles. [2 marks]