Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

A-level Computing AQA Paper 1 Skeleton program 2027

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

I've created an account just to save this, I teach CS A-Level, and this site is a precious source of information and exercises to students and teachers without access to the paid-for resources one education publisher puts out every year. Could an editor please remove the delete tag?}} This is for the 2027 AQA A-level Computer Science Specification (7517). This is where suggestions can be made about what some of the questions might be and how we can solve them. Please be respectful and do not vandalise the page, as this may affect students' preparation for exams!This year Skeleton Program is called "Pile O' Tiles", a two player (arguably multiplayer, see below) version of the classic match-2 memory game. From AQA's preliminary material document: Piles O’ Tiles is a tile matching memory game. The board consists of a two-dimensional grid containing piles of tiles. The tiles are face-down so players cannot see what is on the tiles. Each tile has a symbol (an uppercase letter) and a points value. Players take it in turn to choose two piles. The top tile of those two piles is turned over so that all players can see what is on those tiles. If the two tiles have the same symbol on them then they are removed from the piles and the points for the two tiles are added to the player’s score. The two tiles are then added to a discard. If the two tiles do not have the same symbol on them then they are turned face-down again and put back on the piles they came from. When the game ends the player with the highest score is the winner. In the Skeleton Program the board is shown as a two-dimensional grid with x and y coordinates. Each pile is shown as an integer value that denotes the number of tiles currently in the pile. Then a diagram showing the game's display, with a 6x6 board, rendered as a grid with the origin in the bottom left, row numbers on the left, and column numbers on the bottomIn the Skeleton Program there is a default version of the game that uses a 6×6 grid. It is also possible to load a game from a file. The Data File game1.txt contains a game that can be loaded instead of using the default game. The AQA doc has the content of game1.txt, but we can do better. Annotated game1.txt 16 # Grid size in Nsquares - the grid is the a square of side sqrt of that 2,A,1,E,1,H,3,J,2 # Those are piles (of tiles) 0,E,1,Q,4,K,4,J,2,J,2 # arranged linearly (here, 16 of them) 0,O,1,E,1,H,3 # the first element is the bonus for the tile, 0,O,1,E,1,H,3 # then pairs of letters, score 0,A,1,E,1,H,3 0,A,1,H,1,H,3 0,E,1,E,1,H,3 0,A,1,Q,4,F,3 0,U,1,E,1,H,3 0,A,1,E,1,H,3 4,U,5,E,1,K,4 2,A,1,K,4,H,3 0,A,1,E,1,K,1 0,R,1,K,3,H,3 0,R,1,F,3,K,7 0,A,1,E,1,H,3 2 # Number of players Boris,0 # player name, score Poppy,0 # Discard, in pairs of letters, score - here it's empty 15 # max score 0 # whose turn it is (0 is player 1, Boris) 0 # turns since the the last winning move (matching tiles) by any player # Gamefiles are saves of the gamestate, but here this is the start of a game. ## From https://github.com/WBgrok/AQA-SKCD-2027 ## Courtesy of MrBerard - https://www.youtube.com/watch?v=4n29LNaFdsE 😎👉👉 Annotated Skeleton Code 👉https://github.com/WBgrok/AQA-SKCD-2027/blob/main/Annotated.py Section D mark distribution comparison Mark distribution for this year: - TK (please fill in if you have the EAD) These marks include the screen capture(s), so the marks for the coding will be 1-2 marks lower. The 2026 paper 1 contained 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 practice / predicted tasks Input validation [high confidence] Currently the player can enter data in response to __ChoosePile() (real exam question tell you where to intervene) that will break the game. 🌶️ - VALUES - Assume the user will enter an int, but keep on asking the coordinate until it is within the bounds. 🌶️🌶️ - TYPE - the user can't be trusted to not drool on the keyboard or smth. also check it's an int. If it isn't you should display an error message - feel free to make it very sarcastic, before asking the coordinate again Test VALUES: Press return for default game, then Player 1, enter your choice: T Enter x coordinate: -1 Enter x coordinate: 0 Enter x coordinate: 7 Enter x coordinate: 5 Enter y coordinate: 0 Enter y coordinate: 6 Enter x coordinate: 4 Enter y coordinate: 7 Enter y coordinate: 6 TYPE: Enter filename to load or just press Enter to play the default game: MENU B. Display the board D. Display the discard T. Take turn S. Display scores Player 1, enter your choice: T Enter x coordinate: foo an integer, please Enter x coordinate: 1 Enter y coordinate: bar an integer, please Enter y coordinate: 1 Enter x coordinate: 1 Enter y coordinate: 2 Player 1, you had two matching A tiles; your score has increased by 2 The one that explains `from math import sqrt` [high confidence] ⚠️The fact we go in with N piles, then need to import mths sqrt may indicate a task using sqrt. Given the setup, this has got to be distance between two piles. Hence: 🌶️🌶️🌶️Change the scoring of a matching pair by adding to the tile scores the distance between the two matched piles, rounded down to the nearest integer. Pile clear bonus [high confidence] The game supports almost everything so that when a player match empties a pile, they get a bonus score. The one thing that's missing is in the scoring. 🌶️🌶️ Change the scoring so that if a match empties a pile, the bonus for the pile is awarded to the player. You'll need to add a getter for Pile._Bonus. Test Two cases, as it's possible to empty one or both piles with a match. -game1.txt tells you which piles have the same sequence, that will give you a match that should score both bonus - there's a test sequence to be found that will have one of the player score a single match. Saving [med-high confidence] If you've read the code closely, you'll have noticed the game1.txt is not just a description of game configuration - it is in fact a game save. If you've just run the game, you won't have noticed, because game1 is a save at the very start of the game. So they've given you a load function. Do you see what's coming over the horizon? 👉Add a new menu item "S Save game". This should then call a new method on the Game class, which asks the user for a savename, and writes the game to a file, appending .txt, in the format of game1.txt - here too, you'll need a Pile.GetBonus(). Making the game both more and less boring [low, but good practice] At the moment -certainly in the early game, the default game can be a bit boring, because every pile is the same: an A-tile, for one point a B tile for 2, another A,1. We can make the game less boring, but also longer, and long-term excitement turns out quite boring: 👉 Instead of the default game have all the same piles, keep the same proportion (that's 72 A,1, 36 B,2), but build the pile at random. Basic: If you use a random draw, the game might end up not being endable by zero tiles, but no one gets that far anyway. Fancy: actually draw 72 A1 and 36 B2, as if from a pile of tile, to randomly make the board Party mode [low-mid confidence] The architecture of the game, and what's visible in game1.txt means the game can support an arbitrary number of players. It is just that both the hard-coded default mode and the save file happen to have two players It's lucky, because although any player can hit the maximum score at which the game ends, the winner is always whoever between player 1 and 2 has the highest score, which is enough to run a 6-player AQA skeleton code gaming night like many Y13 enjoy. So you'll need to fix that. 🌶️🌶️🌶️ When starting a default game, it should default to a 6x6 board, and whatever basic pile o' tiles layout we're running (see 'making the game both more and less boring'), but then ask for number of players (validate for an int >0), then, for each, their names (no validation). You will need to fix the scoring bug, although testing that would require engineering a three-way game that ends with a win of the third one. Streak Add an attribute to the Player class storing the number of consecutive wins initalising at zero , with a getter, as well as an increment() and reset() method. Add the value of the streak to the player score when scoring, we should increment if it was a win. If the turn was not a match, call reset() the streak counter to zero. PSYCH! extend the Player class to store last_move, a [(x,y) (x,y)] list of tuples, and a WasMatch boolean, initialising to False Also getters and setters for both On every move, set the last_move record and the boolean accordingly. Here's the psych: if the last move was a miss, AND in the current move the player has selected one of the same piles has their last failed move, swap the tiles of the last move, before turning them over, with a 10% chance, maybe 50% to test it - you'll need to import random either way.