Unit 1, 2015 MS
Unit 1, 2015 MS
Computing
COMP1
Mark scheme
2510
June 2015
It must be stressed that a mark scheme is a working document, in many cases further developed and
expanded on the basis of students’ reactions to a particular paper. Assumptions about future mark
schemes on the basis of one year’s document should be avoided; whilst the guiding principles of
assessment remain constant, details will change, depending on the content of a particular
examination paper.
1 04 1;1000101; 2
R. if not 8 bits
1 05 101.10100 2
R. if not 8 bits
Mark as follows:
3 bits before binary point correct;
5 bits after binary point correct;
1 06 011 0110; 1
R. if not 7 bits
1 07 128 // 1
27;
3 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
1 09 0011 0000; 1
1 10 Recalculate the values for the parity bits using the data bits received (and 4
compare these values with the parity bits received); A. check the parity
bits
Add up the bit positions of the parity bits where a parity checks fails // add
up the bit positions of the calculated parity bits that are different to those
received;
The bit position of where the error has occurred is indicated; R. positions
The contents of the indicated bit position are flipped; R. positions
1 11 7; 1
1 12 No; 1
1 13 2
Initial State Input New State
Sg 1 Sy;
Sy 0 Sy
Sy 1 Sy;
//
Initial State Input New State
Sg 1 Sy;
Sy 0 or 1 Sy;
1 14 Works out if a given input is a (7-bit) ASCII code for a numeric character; 1
4 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
NE. Position/coordinates
NE. Colour
NE. Size
NE. Centre/midpoint
2 18 (For geometric images) less storage space /memory likely to be needed; MAX 3
NE. less space
(For geometric images) will load faster (from secondary storage);
(For geometric images) will download faster;
Can be scaled/resized without distortion;
A. zoom
Image can be (more easily) searched for particular objects;
Can (more easily) manipulate individual objects in an image;
Can preserve the background so that it can be recreated if an object is
deleted;
3 19 5
Mark as follows:
1st column every cell left empty or contains the string Lou; NE. if no
attempt to complete question
1st value in the 2nd column is L;
2nd value in the 2nd column is oL;
3rd value in the 2nd column is uoL;
3rd column correct;
I. speech marks around strings
I. case of letters
5 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
4 21 ****SCREEN CAPTURE**** 1
Must match code from 20, including messages on screen capture
matching those in code. Code for 20 must be sensible.
Mark as follows:
Correct printed output - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
47; A. any suitable format for printed list of numbers
6 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
5 23 BoardDimension; 1
5 25 Board; 1
5 26 Delete the three lines and add one copy of the line after the If 1
statement(s);
Conditions >=97 N N Y Y
<=122 N Y N Y
Action Change value of PlayAgain X
7 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
6 30 ****SCREEN CAPTURE**** 2
Must match code from 29, including prompts on screen capture matching
those in code. Code for 29 must be sensible.
1 BG BE BN BM BS BN BE BG
2 BR BR BR BR BR BR BR
3 BR
6 WR
7 WG WR WR WR WR WR WR WR
8 WE WN WM WS WN WE WG
1 2 3 4 5 6 7 8
Mark as follows:
Correct game position shown;
Correct message and value of 3 displayed;
8 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Maximum of 3 marks if the code, when run, would still execute the line
IF Board[FinishRank][FinishFile][1] "W" THEN in the
CheckMoveIsLegal subroutine when an out-of-bounds finish square is
entered
7 32 ****SCREEN CAPTURE**** 3
Must match code from 31, including prompts on screen capture matching
those in code. Code for 31 must be sensible.
9 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
1 BG BE BN BM BS BN BE BG
2 BR BR BR BR BR BR BR BR
6 WR
7 WR WR WR WR WR WR WR
8 WG WE WN WM WS WN WE WG
1 2 3 4 5 6 7 8
8 33 option for K added to case/if statement with call to 1
CheckSarrumMoveIsLegal; R. if any symbol other than K used
4. Statement that changes the colour of a black piece in the finish square
if it has been ‘captured’ by the kashshaptu - must be inside the selection
structure;
5. When a kashshaptu moves and the finish square did not contain a
black piece the contents of the start square become " " and if the
finish square did contain a black piece the contents stay as "WK";
10 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
8 35 ****SCREEN CAPTURE**** 3
Must match code from 33 and 34, including prompts on screen capture
matching those in code. Code for 33 and 34 must be sensible.
1 WK BG BS WG
3 WS BE BE
6 BR
1 2 3 4 5 6 7 8
3rd move finish square is 21 and board looks like the diagram below;
1 WK WG BS WG
3 WS BE BE
6 BR
1 2 3 4 5 6 7 8
11 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
5th move has finish square of 22, board looks like diagram below and
message Black's sarrum has been captured. White wins!
is displayed;
1 WK WG WG
2 BS
3 WS BE BE
6 BR
1 2 3 4 5 6 7 8
9 36 1. New subroutine GenerateFEN created; R. if spelt incorrectly I. case 13
8. Indicates where the empty spaces on the board are in the FEN record
(even if incorrect representation); A. Incorrect counts of empty spaces
12 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
13. Accurate FEN record would be produced for every possible game
state;
9 38 ****SCREEN CAPTURE**** 2
Must match code from 36 and 37, including prompts on screen capture
matching those in code. Code for 36 and 37 must be sensible.
Mark as follows:
Sample game chosen and the FEN record returned/created by their
subroutine from part 36 is displayed;
Correct FEN record of 1g1s3G/R7/Se5e/8/8/7r/8/8/W is displayed;
13 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Pascal
6 29 Repeat 4
NoOfMoves := 0;
WhoseTurn := 'W';
...
Repeat
...
Repeat
...
Until MoveIsLegal;
MakeMove(Board, StartRank, StartFile, FinishRank,
FinishFile, WhoseTurn);
NoOfMoves := NoOfMoves + 1;
Writeln('The number of moves completed so far: ',
NoOfMoves:3:1);
If GameOver
...
7 31 ... 4
Var
PieceType : Char;
PieceColour : String;
MoveIsLegal : Boolean;
14 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Begin
MoveIsLegal := True;
If (FinishFile = StartFile) And (FinishRank = StartRank)
Then MoveIsLegal := False
Else
If (FinishFile > 8) Or (FinishFile < 1) Or
(FinishRank > 8) Or (FinishRank < 1)
Then MoveIsLegal := False
Else
Begin
PieceType := Board[StartRank, StartFile][2];
...
8 33 ... 1
'S', 'K' : MoveIsLegal := CheckSarrumMoveIsLegal(Board,
StartRank, StartFile, FinishRank, FinishFile);
...
8 34 ... 5
If (WhoseTurn = 'W') And (FinishRank = 1) And (Board[
StartRank, StartFile][2] = 'R')
Then
Begin
Board[FinishRank, FinishFile] := 'WK';
Board[StartRank, StartFile] := ' ';
End
Else
Begin
If (Board[StartRank, StartFile][2] = 'K') And
(Board[FinishRank, FinishFile] <> ' ')
Then Board[FinishRank, FinishFile] :=
Board[StartRank, StartFile][1] +
Board[FinishRank, FinishFile][2]
Else
If (WhoseTurn = 'B') And (FinishRank = 8) And
(Board[StartRank, StartFile][2] = 'R')
Then
Begin
Board[FinishRank, FinishFile] := 'BM';
Board[StartRank, StartFile] := ' ';
...
Alternative answer
...
If (WhoseTurn = 'W') And (FinishRank = 1) And (Board[
StartRank, StartFile][2] = 'R')
Then
Begin
Board[FinishRank, FinishFile] := 'WK';
Board[StartRank, StartFile] := ' ';
End
15 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Else
Begin
If (Board[StartRank, StartFile][2] = 'K') And
(Board[FinishRank, FinishFile] <> ' ')
Then Board[FinishRank, FinishFile] :=
'W' + Board[FinishRank, FinishFile][2]
Else
If (WhoseTurn = 'B') And (FinishRank = 8) And
(Board[StartRank, StartFile][2] = 'R')
Then
Begin
Board[FinishRank, FinishFile] := 'BM';
Board[StartRank, StartFile] := ' ';
...
16 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
9 37 ... 3
DisplayBoard(Board);
Writeln(GenerateFEN(Board, WhoseTurn));
DisplayWhoseTurnItIs(WhoseTurn);
...
17 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
VB.Net
6 29 Do 4
NoOfMoves = 0
WhoseTurn = "W"
...
Do
...
Do
...
Loop Until MoveIsLegal
GameOver = CheckIfGameWillBeWon(Board, FinishRank,
FinishFile)
MakeMove(Board, StartRank, StartFile, FinishRank,
FinishFile, WhoseTurn)
NoOfMoves = NoOfMoves + 1
Console.WriteLine("The number of moves completed so
far: " & NoOfMoves)
If GameOver Then
...
7 31 ... 4
Dim PieceType As String
Dim PieceColour As String
If FinishFile = StartFile And FinishRank = StartRank Then
Return False
End If
If FinishFile > 8 Or FinishFile < 1 Or FinishRank > 8 Or
18 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Alternative answer
...
If WhoseTurn = "W" And FinishRank = 1 And Board(StartRank,
StartFile)(1) = "R" Then
Board(FinishRank, FinishFile) = "WK"
Board(StartRank, StartFile) = " "
ElseIf Board(StartRank, StartFile)(1) = "K" And
Board(FinishRank, FinishFile) <> " " Then
Board(FinishRank, FinishFile) = "W" & Board(FinishRank,
FinishFile)(1)
ElseIf WhoseTurn = "B" And FinishRank = 8 And
Board(StartRank, StartFile)(1) = "R" Then
Board(FinishRank, FinishFile) = "BM"
Board(StartRank, StartFile) = "
Else
Board(FinishRank, FinishFile) = Board(StartRank,
StartFile)
Board(StartRank, StartFile) = " "
End If
...
19 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
9 37 ... 3
DisplayBoard(Board)
Console.WriteLine(GenerateFEN(Board, WhoseTurn))
DisplayWhoseTurnItIs(WhoseTurn)
MoveIsLegal = False
...
20 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
VB6
6 29 Do 4
NoOfMoves = 0
WhoseTurn = "W"
GameOver = False
...
Do
...
Do
...
Loop Until MoveIsLegal
GameOver = CheckIfGameWillBeWon(Board, FinishRank,
FinishFile)
Call MakeMove(Board, StartRank, StartFile, FinishRank,
FinishFile, WhoseTurn)
NoOfMoves = NoOfMoves + 1
WriteLine ("The number of moves completed so far: " &
NoOfMoves)
If GameOver Then
...
21 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
7 31 ... 4
MoveIsLegal = True
If FinishFile = StartFile And FinishRank = StartRank Then
MoveIsLegal = False
Else
If FinishFile > 8 Or FinishFile < 1 Or FinishRank > 8 Or
FinishRank < 1 Then
MoveIsLegal = False
Else
PieceType = Mid$(Board(StartRank, StartFile), 2, 1)
...
8 33 ... 1
Case "S", "K"
MoveIsLegal = CheckSarrumMoveIsLegal(Board, StartRank,
StartFile, FinishRank, FinishFile)
...
8 34 ... 5
If WhoseTurn = "W" And FinishRank = 1 And
Mid$(Board(StartRank, StartFile), 2, 1) = "R" Then
Board(FinishRank, FinishFile) = "WK"
Board(StartRank, StartFile) = " "
ElseIf Mid$(Board(StartRank, StartFile), 2, 1) = "K" And
Board(FinishRank, FinishFile) <> " " Then
Board(FinishRank, FinishFile) = Mid$(Board(StartRank,
StartFile), 1, 1) & Mid$(Board(FinishRank, FinishFile), 2,
1)
ElseIf WhoseTurn = "B" And FinishRank = 8 And
Mid$(Board(StartRank, StartFile), 2, 1) = "R" Then
Board(FinishRank, FinishFile) = "BM"
Board(StartRank, StartFile) = " "
Else
Board(FinishRank, FinishFile) = Board(StartRank,
StartFile)
Board(StartRank, StartFile) = " "
End If
...
Alternative answer
...
If WhoseTurn = "W" And FinishRank = 1 And
Mid$(Board(StartRank, StartFile), 2, 1) = "R" Then
Board(FinishRank, FinishFile) = "WK"
Board(StartRank, StartFile) = " "
ElseIf Mid$(Board(StartRank, StartFile), 2, 1) = "K" And
Board(FinishRank, FinishFile) <> " " Then
Board(FinishRank, FinishFile) = “W” &
Mid$(Board(FinishRank, FinishFile), 2, 1)
ElseIf WhoseTurn = "B" And FinishRank = 8 And
Mid$(Board(StartRank, StartFile), 2, 1) = "R" Then
22 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
9 37 ... 3
Call DisplayBoard(Board)
WriteLine (GenerateFEN(Board, WhoseTurn))
DisplayWhoseTurnItIs (WhoseTurn)
MoveIsLegal = False
...
23 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Java
Alternative solution :
6 29 do { 4
noOfMoves = 0;
whoseTurn = 'W';
...
do {
...
do {
...
}
gameOver = checkIfGameWillBeWon(board, finishRank,
finishFile);
makeMove(board, startRank, startFile, finishRank,
finishFile, whoseTurn);
noOfMoves = noOfMoves + 1;
console.println("The number of moves completed so far:
" + Float.tostring(noOfMoves));
if (gameOver) {
...
24 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
7 31 ... 4
char pieceType;
char pieceColour;
boolean moveIsLegal = true;
if ((finishFile == startFile) && (finishRank == startRank))
{
moveIsLegal = false;
}
if (finishFile > 8 || finishFile < 1 || finishRank > 8 ||
finishRank < 1) {
moveIsLegal = false;
}
pieceType = board[startRank][startFile].charAt(1);
...
8 33 ... 1
case 'S' :
case 'K' :
...
8 34 ... 5
if ((whoseTurn == 'W') && (finishRank == 1) &&
(board[startRank][startFile].charAt(1) == 'R')) {
board[finishRank][finishFile] = "WK";
board[startRank][startFile] = " ";
} else {
if (board[startRank][startFile].charAt(1) == 'K'
&& !board[finishRank][finishFile].equals(" ")) {
Board[finishRank][finishFile] =
Character.toString(board[startRank][startFile].charAt(0)) +
Character.toString(board[finishRank][finishFile].charAt(1))
;
} else {
if ((whoseTurn == 'B') && (finishRank == 8) &&
(board[startRank][startFile].charAt(1) == 'R')) {
board[finishRank][finishFile] = "BM";
board[startRank][startFile] = " ";
} else {
board[finishRank][finishFile] =
board[startRank][startFile];
board[StartRank][startFile] = " ";
}
}
}
...
Alternative Solution
...
if ((whoseTurn == 'W') && (finishRank == 1) &&
25 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
(board[startRank][startFile].charAt(1) == 'R')) {
board[finishRank][finishFile] = "WK";
board[startRank][startFile] = " ";
} else {
if (board[startRank][startFile].charAt(1) == 'K' &&
!board[finishRank][finishFile].equals(" ")) {
board[finishRank][finishFile] = "W" +
Character.toString(board[finishRank][finishFile].charAt(1))
;
} else {
if ((whoseTurn == 'B') && (finishRank == 8) &&
(board[startRank][startFile].charAt(1) == 'R')) {
board[finishRank][finishFile] = "BM";
board[startRank][startFile] = " ";
} else {
board[finishRank][finishFile] =
board[startRank][startFile];
board[startRank][startFile] = " ";
}
}
}
...
26 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
}
FEN = FEN + Character.toString(whoseTurn);
return FEN;
}
9 37 ... 3
moveIsLegal = false;
displayBoard(board);
console.println(generateFEN(board, whoseTurn));
displayWhoseTurnItIs(whoseTurn);
...
27 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
C#
6 29 do 4
{
NoOfMoves = 0;
WhoseTurn = 'W';
...
do
...
do
{
...
} while (!MoveIsLegal)
GameOver = CheckIfGameWillBeWon(ref Board, FinishRank,
FinishFile);
MakeMove(ref Board, StartRank, StartFile, FinishRank,
FinishFile, WhoseTurn);
NoOfMoves = NoOfMoves + 1;
Console.WriteLine("The number of moves completed so
far: " + NoOfMoves.ToString("f1"));
if (GameOver)
...
7 31 ... 4
char PieceType;
char PieceColour;
Boolean MoveIsLegal = true;
if ((FinishFile == StartFile) && (FinishRank == StartRank))
28 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
MoveIsLegal = false;
if (FinishFile > 8 || FinishFile < 1 || FinishRank > 8 ||
FinishRank < 1)
MoveIsLegal = false;
PieceType = Board[StartRank, StartFile][1];
...
8 33 ... 1
case 'S' :
case 'K' :
...
8 34 ... 5
if ((WhoseTurn == 'W') && (FinishRank == 1) &&
(Board[StartRank, StartFile][1] == 'R'))
{
Board[FinishRank, FinishFile] = "WK";
Board[StartRank, StartFile] = " ";
}
else
if (Board[StartRank, StartFile][1] == 'K' &&
Board[FinishRank, FinishFile] != " ")
Board[FinishRank, Finishfile] = Board[StartRank,
StartFile][0].ToString + Board[FinishRank,
Finishfile][1].ToString();
else
if ((WhoseTurn == 'B') && (FinishRank == 8) &&
(Board[StartRank, StartFile][1] == 'R'))
{
Board[FinishRank, FinishFile] = "BM";
Board[StartRank, StartFile] = " ";
}
else
{
Board[FinishRank, FinishFile] = Board[StartRank,
StartFile];
Board[StartRank, StartFile] = " ";
}
...
Alternative Solution
...
if ((WhoseTurn == 'W') && (FinishRank == 1) && (Board[
StartRank, StartFile][1] == 'R'))
{
Board[FinishRank, FinishFile] = "WK";
Board[StartRank, StartFile] = " ";
}
else
if (Board[StartRank, StartFile][1] == 'K' &&
29 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
30 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
9 37 ... 3
MoveIsLegal = false;
DisplayBoard(ref Board);
Console.WriteLine(GenerateFEN(Board, WhoseTurn));
DisplayWhoseTurnItIs(WhoseTurn);
...
31 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Python 2
8 33 if MoveIsLegal == True: 1
if PieceType == "R":
MoveIsLegal = CheckRedumMoveIsLegal(Board, StartRank,
StartFile, FinishRank, FinishFile, PieceColour)
elif PieceType == "S" or PieceType == "K":
MoveIsLegal = CheckSarrumMoveIsLegal(Board, StartRank,
32 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Alternative answer
33 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
else:
if NoOfSpaces > 0:
FEN = FEN + str(NoOfSpaces)
NoOfSpaces = 0
if Board[RankNo][FileNo][0] == "B":
FEN = FEN + Board[RankNo][FileNo][1].lower()
else:
FEN = FEN + Board[RankNo][FileNo][1]
if NoOfSpaces > 0:
FEN = FEN + str(NoOfSpaces)
FEN = FEN + "/"
FEN = FEN + WhoseTurn
return FEN
9 37 while not(GameOver): 3
DisplayBoard(Board)
print GenerateFEN(Board, WhoseTurn)
DisplayWhoseTurnItIs(WhoseTurn)
MoveIsLegal = False
while not(MoveIsLegal):
...
34 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Python 3
8 33 if MoveIsLegal == True: 1
if PieceType == "R":
MoveIsLegal = CheckRedumMoveIsLegal(Board, StartRank,
StartFile, FinishRank, FinishFile, PieceColour)
elif PieceType == "S" or PieceType == "K":
MoveIsLegal = CheckSarrumMoveIsLegal(Board,
35 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
Alternative answer
36 of 37
MARK SCHEME – AS LEVEL COMPUTING – COMP1 – JUNE 2015
if NoOfSpaces > 0:
FEN = FEN + str(NoOfSpaces)
NoOfSpaces = 0
if Board[RankNo][FileNo][0] == "B":
FEN = FEN + Board[RankNo][FileNo][1].lower()
else:
FEN = FEN + Board[RankNo][FileNo][1]
if NoOfSpaces > 0:
FEN = FEN + str(NoOfSpaces)
FEN = FEN + "/"
FEN = FEN + WhoseTurn
return FEN
9 37 while not(GameOver): 3
DisplayBoard(Board)
print (GenerateFEN(Board, WhoseTurn))
DisplayWhoseTurnItIs(WhoseTurn)
MoveIsLegal = False
while not(MoveIsLegal):
...
37 of 37