Jump to content

A-level Computing AQA Paper 1 Skeleton program 2027

From Wikibooks, open books for an open world

Soft redirect to:v:en:A-level Computer Science AQA Paper 1 Skeleton program 2027
This page is a soft redirect.


Section C Mark distribution comparison

[edit | edit source]

Mark distribution for this year:

The 2027 paper 1 will contain 4 questions worth 2, 3, 6, and 2 marks (13 total).

The 2026 paper 1 contained 5 questions worth 3, 2, 5, 2 and 1 mark(s) (13 total).

The 2025 paper contained 4 questions worth 2 marks each (8 total).

The 2024 paper contained 3 questions worth 11 marks in total (3+2+6=11).

The 2023 paper contained 6 questions worth 13 marks

The 2022 paper contained 5 questions worth 17 marks.

The 2021 paper contained 4 questions worth 13 marks.

Section C Predictions

[edit | edit source]

Predictions:





Section D Mark distribution comparison

[edit | edit source]

Mark distribution for this year:

  • The 2027 paper 1 contains 4 questions: a 6 mark, a 7 mark, an 11 mark and a 13 mark question.

These marks include the screen capture(s), so the marks for the coding will be 1-2 marks lower.

  • The 2026 paper 1 contains 4 questions: a 5 mark, an 8 mark and two 12 mark questions.
  • The 2025 paper 1 contained 4 questions: a 5 mark, a 6 mark and two 14 mark questions.
  • The 2024 paper 1 contained 4 questions: a 5 mark, a 6 mark and two 14 mark questions.
  • The 2023 paper 1 contained 4 questions: a 5 mark, a 9 mark, a 10 mark and one 13 mark question.
  • The 2022 paper 1 contained 4 questions: a 5 mark, a 9 mark, a 11 mark and one 13 mark question.
  • The 2021 paper 1 contained 4 questions: a 6 mark, an 8 mark, a 9 mark and one 14 mark question.
  • The 2020 paper 1 contained 4 questions: a 6 mark, an 8 mark, a 11 mark and one 12 mark question.
  • The 2019 paper 1 contained 4 questions: a 5 mark, an 8 mark, a 9 mark and one 13 mark question.
  • The 2018 paper 1 contained 5 questions: a 2 mark, a 5 mark, two 9 mark and one 12 mark question.
  • The 2017 paper 1 contained 5 questions: a 5 mark, three 6 mark and one 12 mark question.

Section D Predictions

[edit | edit source]

Q1: Write code to utilize Bonus when a player clears a pile, or use TurnsSinceMatch to trigger a board reshuffle when players get stuck.

[edit | edit source]

C#:


Python:


Q2: Modify board creation or grid coordinate calculations to validate that board sizes loaded from external files form valid square dimensions.

[edit | edit source]

C#:


Python:

Q3: Refactor Pile.GetSymbolOfTopTile() to return a fallback character (e.g., ' ' or '?') or throw a defensive guard check if the pile is empty.

[edit | edit source]

C#:


Python:

Q4: Modify TilesCS.Main() so that when setting up a default game, the user is prompted to enter a custom target score (MaxScore) rather than using the hardcoded value of 10.

[edit | edit source]

C#:

GK - Coombe Wood School - South Croydon

if (UseDataFromFile == false)
 {
     Players.Add(new Player("Player 1", 0));
     Players.Add(new Player("Player 2", 0));
     for (int Count = 1; Count <= 36; Count++)
     {
         Pile P = new Pile(3, 0);
         P.Add(new Tile('A', 1));
         P.Add(new Tile('B', 2));
         P.Add(new Tile('A', 1));
         Board.Add(P);
     }
     //start change
     Console.WriteLine("Enter a target score");
     MaxScore = int.Parse(Console.ReadLine());
     //end change
 }

Python:

    if UseDataFromFile == False:
        Players.append(Player("Player 1", 0))
        Players.append(Player("Player 2", 0))

        for Count in range(1, 37):
            P = Pile(3, 0)
            P.Add(Tile("A", 1))
            P.Add(Tile("B", 2))
            P.Add(Tile("A", 1))
            Board.append(P)

        # -- Start Changes --
        MaxScoreInput=input("Enter a max score: ")
        if type(MaxScoreInput)==int:
            MaxScore=MaxScoreInput
        else:
            print("Using default max score (10)")
        # -- End Changes --


Q5: Update the DisplayScores() method in Game so that in addition to printing player scores, it prints which player is currently winning or states that the game is currently a tie.

[edit | edit source]

C#:

GK - Coombe Wood School - South Croydon

private void DisplayScores()
{
    Console.WriteLine();
    foreach (Player P in Players)
    {
     Console.WriteLine($"{P.GetName()}: has a score of {P.GetScore()}");
    }
    //start change
    if (Players[1].GetScore() > Players[0].GetScore())
    {
        Console.WriteLine($"{Players[1].GetName()} is winning");
    }
    else if (Players[1].GetScore() < Players[0].GetScore())
    {
        Console.WriteLine($"{Players[0].GetName()} is winning");
    }
    else if (Players[1].GetScore() == Players[0].GetScore())
    { 
       Console.WriteLine("The game is currently a tie.");
    }
        //end change
        
    Console.WriteLine();
}

Python:

Caistor Grammar School - Lincolnshire

def __DisplayScores(self):
        print()
        for P in self.__Players:
            print(f"{P.GetName()}: has a score of {P.GetScore()}")
        print()
        # -- Start Changes --
        if self.__Players[0]._Score>self.__Players[1]._Score:
            print(f"{self.__Players[0].GetName} Is winning")

        elif self.__Players[0]._Score<self.__Players[1]._Score:
            print(f"{self.__Players[1].GetName} Is winning")

        else:
            print("Both players are tied")
        # -- End Changes --


Q6: Add a method CountTotalTiles() to the Game class that counts and returns the total number of tiles remaining across all piles on the board. Display this total when the board is displayed ('B').

[edit | edit source]

C#:

GK - Coombe Wood School - South Croydon

//total number of tiles
//start change
private int CountTotalTiles()
{
    int total = 0;

    for (int i = 0; i < Board.Count; i++)
    {
        total += Board[i].GetNumberOfTiles();
    }
    return total;
}
//end change

DisplayMenu();
Choice = GetChoice();
if (Choice == "B")
{
    DisplayBoard();
    //start change
    Console.WriteLine($"Total number of tiles {CountTotalTiles()}");
    //end change               
}

Python:

OPGS - Kent

# New Method in game class
def __CountTotalTiles(self):
    total = 0
    for P in self.__Board:
        total += P.GetNumberOfTiles()
    return total

#Change to displayBoard method
def __DisplayBoard(self):
        for y in range (self.__GridSize, 0, -1):
            print(f"{y}|", end="")
            for x in range(1, self.__GridSize + 1):
                print(self.__Board[self.__GetIndex(x, y)].GetNumberOfTiles(), end="")
            print()
        print("  ", end="")
        for x in range(1, self.__GridSize + 1):
            print("-", end="")
        print()
        print("  ", end="")
        for x in range (1, self.__GridSize + 1):
            print(x, end="")
        print()
        # New code
        print(f"Total tiles remaining: {self.__CountTotalTiles()}")
        print()
        # End new code

Q7: Modify ChoosePile() in the Game class to validate that both user-entered X and Y coordinates fall within valid grid boundaries (1 \le x {GridSize} and 1 \le y \le{GridSize}) before calculating the index.

[edit | edit source]

C#:


Python:

Q8: The Pile class contains an unused Bonus field. Add a method GetAndClearBonus() to Pile that returns the bonus value and resets it to 0. Update PlayGame() in Game so that when a matching pair is found, any bonus points from the two chosen piles are added to the player's score.

[edit | edit source]

C#:


Python:

Q9: Extend the Player class to keep track of how many successful matching pairs each player has made during the game. Display this count in DisplayScores().

[edit | edit source]

C#:

JO: Coombe Wood School - South Croydon

JO
// START CHANGE class Player
protected int SuccessMatches = 0;
public virtual void NumberOfSuccessfulMatches()
{
    SuccessMatches++;
}
public virtual int ReturnMatches()
{
    return SuccessMatches;
}
//END CHANGE
//START CHANGE DisplayScores
Console.WriteLine($"{Players[0].GetName()} has {Players[0].ReturnMatches()} successful matches");
Console.WriteLine($"{Players[1].GetName()} has {Players[1].ReturnMatches()} successful matches");
// END CHANGE

Python:

Caistor Grammar School - Lincolnshire

def PlayGame(self):
                    # Code Omitted
                    ScoreIncrease += Tile1.GetPoints() + Tile2.GetPoints()
                    self.__Players[self.__WhoseTurn].ChangeScore(ScoreIncrease)
                    # -- Start Changes : PlayGame --
                    self.__Players[self.__WhoseTurn].match()
                    # -- End Changes --

def __DisplayScores(self):
        print()
        for P in self.__Players:
            # -- Start Changes : __DisplayScores --
            print(f"{P.GetName()}: has a score of {P.GetScore()} with {P.GetSuccessfulPairs()} Successful Pair(s)")
            # -- End Changes --
        print()

# -- Start Changes : Player --
    def GetSuccessfulPairs(self):
        return self._SuccessfulPairs

    def match(self):
        self._SuccessfulPairs+=1
# -- End Changes --


Q10: Add a new menu option 'P' ("Peek at Pile") to Game. When selected, prompt the user for coordinates and display all tile symbols contained within that specific pile from top to bottom without removing any tiles.

[edit | edit source]

C#:


Python:


Q11: In Game.PlayGame(), if 5 consecutive turns occur without a single successful match (TurnsSinceMatch >= 5), automatically discard the top tile of every non-empty pile on the board to refresh the grid state, and reset

[edit | edit source]

C#:

JB: Coombe Wood School - South Croydon

TurnsSinceMatch = 0.
// ANNOTATION: Player taking a turn selects two piles
int Pile1 = ChoosePile();
int Pile2;
do
{
    Pile2 = ChoosePile();
} while (Pile1 == Pile2); // Ensure they don't pick the exact same pile twice

TurnsSinceMatch++;
int resetGame = 0;
// ANNOTATION: Check if both chosen piles actually have tiles in them
if (Board[Pile1].Empty() == false && Board[Pile2].Empty() == false)
{
    // ANNOTATION: Match Check! Compare the top tile symbols
    if (Board[Pile1].GetSymbolOfTopTile() == Board[Pile2].GetSymbolOfTopTile())
    {
        TurnsSinceMatch = 0; // Reset counter

        // Remove top tiles from the board
        Tile Tile1 = Board[Pile1].Remove();
        Tile Tile2 = Board[Pile2].Remove();

        // Add them to discard
        Discard.Add(Tile1);
        Discard.Add(Tile2);

        // Calculate score (sum of both tile point values)
        int ScoreIncrease = 0;
        ScoreIncrease += Tile1.GetPoints() + Tile2.GetPoints();
        Players[WhoseTurn].ChangeScore(ScoreIncrease);
        Console.WriteLine($"{Players[WhoseTurn].GetName()}, you had two matching {Tile1.GetSymbol()} tiles; your score has increased by {ScoreIncrease}");
        resetGame = 0;
    }
    else
    {
        Console.WriteLine("You did not find a matching pair.");
        Console.WriteLine($"The first pile you chose had a {Board[Pile1].GetSymbolOfTopTile()}");
        Console.WriteLine($"The second pile you chose had a {Board[Pile2].GetSymbolOfTopTile()}");
        resetGame += 1;
        Console.WriteLine(resetGame);
        if (resetGame == 5)
        {
            TurnsSinceMatch = 0;
            for (int i = 0; i < Board.Count - 1; i++)
            {
                Tile Tilei = Board[Pile1].Remove();
            }
        }
    }

Python:


Q12: Add a static method SaveGame(...) to TilesCS that saves the current state of the game (Board, Players, Discard, MaxScore, WhoseTurn, TurnsSinceMatch) to a text file using the exact structure expected by LoadGame().

[edit | edit source]

C#:


Python:


Q13: Create a subclass SpecialTile inheriting from Tile. It includes a boolean attribute IsDoublePoints. Override GetPoints() so that if IsDoublePoints is true, the method returns twice the standard base points.

[edit | edit source]

C#:


Python:


Q14: Create a subclass WildcardTile inheriting from Tile with symbol '*'. Modify PlayGame() in Game so that if either selected top tile is a WildcardTile ('*'), the selection automatically counts as a match with any other symbol

[edit | edit source]

C#:


Python:

Caistor Grammar School - Lincolnshire

def PlayGame(self):
            # Code Omitted
            if self.__Board[Pile1].Empty() == False and self.__Board[Pile2].Empty() == False:
                # -- Start Changes --
                if self.__Board[Pile1].GetSymbolOfTopTile() == self.__Board[Pile2].GetSymbolOfTopTile() or self.__Board[Pile1].GetSymbolOfTopTile()=="*" or self.__Board[Pile2].GetSymbolOfTopTile()=="*":
                    self.__TurnsSinceMatch = 0
                    Tile1 = self.__Board[Pile1].Remove()
                    Tile2 = self.__Board[Pile2].Remove()
                    self.__Discard.append(Tile1)
                    self.__Discard.append(Tile2)
                    ScoreIncrease = 0
                    if Tile1.GetSymbol()=="*":
                        ScoreIncrease=Tile2.GetPoints*2
                    elif Tile2.GetSymbol()=="*":
                        ScoreIncrease=Tile1.GetPoints*2
                    else:
                        ScoreIncrease += Tile1.GetPoints() + Tile2.GetPoints()
                    # -- End Changes --

# -- Start Changes --
class WildTile(Tile):
    def __init__(self):
        super().__init__("*",3)
# -- End Changes --


Q15: Create a derived class AIPlayer inheriting from Player. Add a method SelectPiles(List<Pile> Board) that scans the board for two non-empty piles sharing identical top tiles and returns their indices. If no match is visible, return the first two available non-empty pile indices.

[edit | edit source]

C#:


Python:


Q16: Add an Undo feature to Game. If a player makes a successful match, store the removed tiles, pile indices, and score awarded. Add menu option 'U' to undo the last move, returning the tiles from Discard back into their respective piles and deducting the awarded score from the player.

[edit | edit source]

C#:


Python:


Q17: Allow each player a maximum of 1 "Peek" ability per game. Add option 'V' to the menu. When used, the current player selects a pile and previews the symbol of the second tile down in that pile without removing it. Subtract 1 from their available peeks.

[edit | edit source]

C#:

JO: Coombe Wood School - South Croydon

 // start change in Player Class
    protected int PeekAbility = 1;
    public virtual bool Peek()
    {
        if (PeekAbility  == 1)
        {
            PeekAbility--;
            return true;
        }
        else
        {
            return false;
        }
    }
    // end change
   while (GameOver == false)
{
    string Choice = "";
    while (Choice != "T")
    {
        DisplayMenu();
        Choice = GetChoice();
        if (Choice == "B")
        {
            DisplayBoard();
        }
        else if (Choice == "D")
        {
            DisplayDiscard();
        }
        else if (Choice == "S")
        {
            DisplayScores();
        }

        // start change
        else if (Choice == "V")
        {
            DisplaySecondTile();
        }
        // end change
    }
            


   // start change in Class Game
    private void DisplaySecondTile()
    {
        if (Players[WhoseTurn].Peek() == true)
        {
            int PilePeek = ChoosePile();
            char TopTile = Board[PilePeek].GetSymbolOfTopTile();
            Board[PilePeek].Remove();
            Console.WriteLine(Board[PilePeek].GetSymbolOfTopTile());
            Board[PilePeek].Add(new Tile(TopTile, 0));
        }
        else
        {
            Console.WriteLine("Peek has already been used!");
        }
    }
    // end change
private void DisplayMenu()
{
    Console.WriteLine();
    Console.WriteLine();
    Console.WriteLine("MENU");
    Console.WriteLine("B. Display the board");
    Console.WriteLine("D. Display the discard");
    Console.WriteLine("T. Take turn");
    Console.WriteLine("S. Display scores");
    //start change
    Console.WriteLine("V. Peek at pile");
    //end change
    Console.WriteLine();
}

Python:

Q18: Create a derived class TrapPile inheriting from Pile. If a matching pair of tiles is removed where either selected pile is a TrapPile, convert the score gain into a penalty (subtract points instead of adding).

[edit | edit source]

C#:


Python:

Q19:Modify Game to support non-square grids (e.g., Width \times Height = 20 piles total). Replace GridSize with GridWidth and GridHeight. Update GetIndex(x, y) and DisplayBoard() accordingly.

[edit | edit source]

C#:


Python:

Q20: Create a MoveLog class to track turn events. Record player name, chosen pile coordinates, matched symbols, and points earned. Add menu option 'H' to print a structured text table summarizing all completed turns in the current game session.

[edit | edit source]

C#:


Python:

Section D: Issues with the Code and Fixes :

[edit | edit source]

Issue 1: When entering a choice, the way the program detects what choice the player has inputted is case sensitive. Entering ‘b’ rather than ‘B’ will prompt the user to enter their choice again.

[edit | edit source]

C#:

Coombe Wood School - South Croydon

// Start change
Choice = Console.ReadLine().ToUpper();
// end change

Python:

Caistor Grammar School - Lincolnshire

# Start change
Choice = input(f"{self.__Players[self.__WhoseTurn].GetName()}, enter your choice: ").upper()
# End change


Issue 2: The program allows the user to enter x and y coordinates out of the 1-6 range

[edit | edit source]

C#:

Coombe Wood School - South Croydon

// Start change
while (x>6 || x<1 || y>6 || y<1)
{
    Console.WriteLine("Please enter within the range of 1-6");
    Console.Write("Enter x coordinate: ");
    x = Convert.ToInt32(Console.ReadLine());
    Console.Write("Enter y coordinate: ");
    y = Convert.ToInt32(Console.ReadLine());

}
return GetIndex(x, y);
// end change

Python:

Caistor Grammar School - Lincolnshire Edited to work with any grid size: OPGS - Kent

    def __ChoosePile(self):
        x = 0
        y = 0
        # -- Start Changes --
        while x<1 or x>self.__GridSize or y<1 or y>self.__GridSize:
            print()
            print(f"For each coordinate enter a number between 1 and {self.__GridSize}")
            x = int(input("Enter x coordinate: "))
            y = int(input("Enter y coordinate: "))
            print()
            # -- End Changes --
        return self.__GetIndex(x, y)


Issue 3: If player 1 and player 2 get the same score, the game ends and a tie isn't declared.

[edit | edit source]

C#:

Coombe Wood School - South Croydon

// Start change
else if (Players[1].GetScore() == Players[0].GetScore())
{
    Console.WriteLine("The game is a tie.");
}
// end change

Python:

I stand to be corrected but I don't think this can actually happen. After a player gains points it checks to see if they reached the maximum before ending the game. If the other player had already reached the MaxScore it would have stopped on their turn.

Caistor Grammar School - Lincolnshire

def PlayGame(self):
        #Code Omitted
        if self.__Players[0].GetScore() > self.__Players[1].GetScore():
            print(f"{self.__Players[0].GetName()} has won!")
        elif self.__Players[1].GetScore() > self.__Players[0].GetScore():
            print(f"{self.__Players[1].GetName()} has won!")
        # -- Start Changes --
        else:
            print("The game ends in a tie.")
        # -- End Changes --


Issue 4: The program doesn’t display any error messages to the user when they choose the same pile.

[edit | edit source]

C#:

Coombe Wood School - South Croydon

int Pile1 = ChoosePile();
// START CHANGE
int Pile2 = ChoosePile();
while (Pile1 == Pile2)
{
     Console.WriteLine("Please input a different tile");
     Pile2 = ChoosePile();
}
// END CHANGE

Python:

Caistor Grammar School - Lincolnshire

def PlayGame(self):
            #Code Omitted
            Pile1 = self.__ChoosePile()
            Pile2 = self.__ChoosePile()
            while Pile1 == Pile2:
                # -- Start Changes --
                print("Pile 2 must be different to Pile 1")
                # -- End Changes
                Pile2 = self.__ChoosePile()


Issue 5: If a letter which is not on the display menu is entered, there is no error message or a message to prompt the user to enter a valid letter

[edit | edit source]

C#:

Coombe Wood School - South Croydon

while (Choice.ToUpper() != "T")
{
    DisplayMenu();
    Choice = GetChoice();
    if (Choice.ToUpper() == "B")
    {
        DisplayBoard();
    }
    else if (Choice.ToUpper() == "D")
    {
        DisplayDiscard();
    }
    else if (Choice.ToUpper() == "S")
    {
        DisplayScores();
    }
    // CHANGE
    else if (Choice.ToUpper() != "T")
    {
        Console.WriteLine("That is not a valid menu option.");
    }
    // END CHANGE
}

Python:

Caistor Grammar School - Lincolnshire

    def PlayGame(self):
        while self.__GameOver == False:
            Choice = ""
            while Choice != "T":
                self.__DisplayMenu()
                Choice = self.__GetChoice()
                if Choice == "B":
                    self.__DisplayBoard()
                elif Choice == "D":
                    self.__DisplayDiscard()
                elif Choice == "S":
                    self.__DisplayScores()
                # -- Start Changes -- 
                elif Choice != "T":
                    print("Please enter a valid option")
                # -- End Changes --


Issue 6: Before the tiles are matched, the code should check if the pile is empty or the players turn is wasted

[edit | edit source]

C#:

Coombe Wood School - South Croydon

  int Pile1 = ChoosePile();
            // START Change
            while (Board[Pile1].Empty() == true)
            {
                Console.WriteLine("Empty tile");
                Pile1 = ChoosePile();
            }
            int Pile2 = ChoosePile();
            while (Board[Pile2].Empty() == true)
            {
                Console.WriteLine("Empty Tile");
                Pile2 = ChoosePile();
            }
            // end change


else
{
    Console.WriteLine("You chose an empty pile");
    //player is given another turn if pile is empty
    //start change
    PlayGame();
    //end change
}

Python:

Caistor Grammar School - Lincolnshire

def PlayGame(self):
            #Code Omitted
            Pile1 = self.__ChoosePile()
            # -- Start Changes --
            while Pile1.Empty():
                print("Please pick a pile that isn't empty")
                Pile1=self.__ChoosePile
            Pile2 = self.__ChoosePile()
            while Pile2.Empty():
                print("Please pick a pile that isn't empty")
                Pile2=self.__ChoosePile()
            # -- End Changes --
            while Pile1 == Pile2:
                Pile2 = self.__ChoosePile()

Issue 7: When invalid input is entered code crashes

[edit | edit source]

C#:

Coombe Wood School - South Croydon

int x = 0, y = 0;
// CHANGE
try
{
    Console.Write("Enter x coordinate: ");
    x = Convert.ToInt32(Console.ReadLine());
    Console.Write("Enter y coordinate: ");
    y = Convert.ToInt32(Console.ReadLine());
    return GetIndex(x, y);
} catch (Exception)
{
    Console.WriteLine("Invalid input");
    ChoosePile();
}
// END CHANGE

Python:

Issue 8: When the game finishes, it does not display the scores of both users

[edit | edit source]

C#:

Coombe Wood School - South Croydon

//start change
if (Players[0].GetScore() > Players[1].GetScore())
{
    Console.WriteLine($"{Players[0].GetName()} has won! Score:" + Players[0].GetScore());
}
else if (Players[1].GetScore() > Players[0].GetScore())
{
    Console.WriteLine($"{Players[1].GetName()} has won! Score:" + Players[1].GetScore());
}
//end change

Python:

Caistor Grammar School - Lincolnshire

def PlayGame(self):
        #Code Omitted
        if self.__Players[0].GetScore() > self.__Players[1].GetScore():
            print(f"{self.__Players[0].GetName()} has won!")
            # -- Start Changes --
            self.__DisplayScores()
            # -- End Changes --
        elif self.__Players[1].GetScore() > self.__Players[0].GetScore():
            print(f"{self.__Players[1].GetName()} has won!")
            # -- Start Changes --
            self.__DisplayScores()
            # -- End Changes --


Issue 9: The x coordinates can go above the boundary of 1-6

[edit | edit source]

C#:

Coombe Wood School - South Croydon

// CHANGE
try
{
    do
    {
        Console.Write("Enter x coordinate: ");
        x = Convert.ToInt32(Console.ReadLine());

        if (x > GridSize || x < 1)
        {
            Console.WriteLine("Out of bounds. Enter a value within the range of the grid.");
        }

    } while (x > GridSize || x < 1);

    do
    {
        Console.Write("Enter y coordinate: ");
        y = Convert.ToInt32(Console.ReadLine());

        if (y > GridSize || y < 1)
        {
            Console.WriteLine("Out of bounds. Enter a value within the range of the grid.");
        }

        return GetIndex(x, y);

    } while (y > GridSize || y < 1);
}
catch (Exception)
{
    Console.WriteLine("Invalid input");
    ChoosePile();
}
return 0;
// END CHANGE

Python: