A-level Computing/AQA/Paper 1/Skeleton program/2019

This is for the AQA A-level Computer Science Specification.

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 or tamper with this page, as this would affect students' preparation for their exams!

Section C Predictions
Theory Questions on Skeleton Code:


 * The Skeleton Program loads the game data from a binary file. State two reasons why a binary file might have been chosen for use with the Skeleton Program instead of a text file. [2 mark]

The GetIndexOfItem subroutine is used to find the position of an item in Items. The item to find can be specified using either its name or its ID


 * 1) Explain what it means if a value of -1 is returned by GetIndexOfItem. [1 mark]
 * 2) How does the subroutine GetIndexOfItem know if it should try to find the item using the name or the ID passed to it as parameters? [1 mark]
 * 3) What is the time complexity of the algorithm used to find an item in the GetIndexOfItem subroutine? [1 mark]
 * 4) There is an error in the code for the Skeleton Program that does not cause a problem when using the data in the game files provided but could cause a problem with alternative game files. Under what circumstances will the GetIndexOfItem subroutine return the index of an item that was not the item being searched for? [2 marks]
 * 5) If the Skeleton Program had been designed to use a hash table to store the items it is likely that it would be able to find the position of an item, when given its ID, in less time than the algorithm currently used in the subroutine GetIndexOfItem. [3 marks]
 * 6) Explain the steps involved in finding an item in the hash table. You should assume that all the items available in the game have already been successfully added into the hash table. [4 marks]
 * 7) Give one reason why a hash table is not a suitable choice to store the items in the Skeleton Program. [1 mark]

A set is an unordered collection of values in which each value occurs at most once. The items in the game can be described using sets. Four operations that can be performed on sets are union, difference, intersection and membership.
 * The set A contains all the items in the game.
 * The set B contains all the items that have “use” in their Commands.
 * The set C contains all the items that have “gettable” in their Status.
 * The set D contains all the items in the player’s inventory.
 * The set E contains all the items which have a Location equal to the CurrentLocation of the player and that have “usable” in their Status.
 * The set F contains all the items which have a Location equal to the CurrentLocation.


 * 1) Explain how the operations can be used with some of the sets A–F to produce the set of items that the player can use in the current game state. [3 marks]
 * 2) The set described in the above bullet point is a proper subset of some of the sets A–F. List all of the sets (A–F) that it is a proper subset of. [1 mark]
 * 3) Explain why the intersection of sets F and C does not contain all the items that the player can currently get. [1 mark]
 * 4) Explain the difference between a subset and a proper subset. [1 mark]

Section D Predictions
Programming Questions on Skeleton Program


 * The 2018 paper 1 contained one 2 mark question, a 5 mark question, two 9 mark questions, and one 12 mark question - these marks include the screen capture(s). In contrast, the 2017 paper 1 contained a 5 mark question, three 6 mark questions, and one 12 mark question.
 * The 2019 paper 1 will contain 4 questions: a 5 mark, an 8 mark question, a 9 mark question and one 13 mark question - these marks include the screen capture(s), so the likely marks for the coding will be 1-2 marks lower.

This list was created based on analysis of the flag files, ZigZag Education suggestions, and suggestions contained on this Wikibooks page. Please add to this list if you can establish any other likely section D questions.

Most likely predictions:

Note that these mark suggestions include marks for screen capture(s).


 * Help command (2 marks)
 * Allow file name with/without extension (2 marks)
 * Examine room (2+ marks)
 * Look into next room for a room description if the door is open (5 marks)
 * Have to move rug before being able to open the trapdoor (5 marks)
 * Drop item (5 marks)
 * Fight the guard using the truncheon (use truncheon command) (5 marks)
 * Eat command (5 marks - including regenerating health could be 9 marks)
 * Save game using save command (5 marks)
 * Player has HP + eating regenerates health (9 marks)
 * Filling/drinking from containers - eg. the flask and barrel (9 marks)
 * Movement history (9+ marks)
 * Go command automatically unlocks and opens doors if you have the key (9+ marks)
 * Limit inventory space by item size - tiny, small, and medium items (9+ marks)

Other Ideas
Ideas waiting to be programmed


 * Open and close all doors in the current location
 * Create a new location/room
 * give an item to the guard i.e. red dice
 * add water to the barrel which can then be put in the flask
 * Give an option to pick the lock of a door based on percentage chance, if it fails the guard arrests you
 * Add benefits to sleeping i.e. higher chance of winning dice
 * Save game
 * when "use chair" is executed, it states it can't be done, however the file says the guard won't let you sit on his lap. need a fix?

Unlikely, the .gme file has the incorrect instruction attached to the use function of the chair.

The gme file should have "say,The guard won't let you sit on his lap" not "use,The guard won't let you sit on his lap"

its likely this is just a left over piece of data, no surprise as the code is of questionable quality. r/iamverysmart

r/ihavereddit

r/computerscience

History Stack
Taken from ZigZag's example questions.

History uses a stack, to allow players to go to previous locations by typing 'go back' or to display previous locations by typing 'history'. You need 2 subroutines: Push, to add a new visited location, and Pop, to remove to last location from the stack and return it. If the stack is empty this should return -1.

Automatically unlock and open doors
SM HGS, Difficulty: New Game +

Allow file name with/without extension
Modify the source code to allow for the file name to be entered with/without the file extension (".gme").

Are you sure you want to quit?
Modify the source code to ask the user whether they are sure they want to quit the game.

If just 'help' is typed, a list of existing commands appear
Create 'help ' which lists details about individual instruction,

If just 'help' is typed, a list of existing commands appear.

Create 'teleport ' command
Create 'teleport ' command. Useful for testing game..

Create 'save ' command
Create 'save ' command. Saves the current status of game.

Add instruction to add a new character to game
Add instruction to add a new character to game. eg 'addcharacter '

Add 'examine room' option to view details of room again
Add 'examine room' option to view details of room again. Fairly simple but a useful option when developing 'addcharacter' or 'additem'.

private static void Examine(List items, List characters, string itemToExamine, int currentLocation, List places) {           int Count = 0; if (itemToExamine == "inventory") {               DisplayInventory(items); }           if (itemToExamine == "room") {               Console.Write(places[characters[0].CurrentLocation - 1].Description); DisplayGettableItemsInLocation(items, characters[0].CurrentLocation);

}

Create new items for the game via an 'additem '
Create new items for the game via an 'additem ' command. Useful once you have created 'save ' option.

Create a new 'drop ' command.
Create 'drop ' command that drops the item selected from the user's Inventory

Count the number of moves a player makes / Save a high score
Display the number of moves a player has made. Used to determine a high score once the flag has been found. High score can be compared to a stored high score, and updated if current high score is higher.

Prevent guard from taking the dice if you lose
Prevent guard from taking the dice if you lose. Alternatively restart game.

Create 'time' command.
Create 'time' command. It should tell you how many minutes you have been playing. Alternative add the time (eg how many mins) you have been in the game each time you move from room to room - Note: I doubt that they would ask you to do this as it is trivial in some languages and more difficult in others. More realistically it may ask you to count the number of instructions the player has typed throughout the game.

Limit Inventory Size by Item Count
Limit the number of items that can be added to the inventory SM HGS, Difficulty: Veteran

Limit Inventory Size by Item Weight
All gettable items are either 'tiny, 'small' or 'medium'. Introduce a weighInventory sub-routine. Tiny = weight of 1, Small = weight of 2 and medium = weight of 3. Only allow an item to be collected if it won't take the inventory weight over 7.

Hit the guard with a weapon
Hit the guard(or any character in the room) with an object with weapon status and then take an item from them.

Create Attack System with Health
Add a 'health' attribute to characters that can be changed in the code (or a command could be added for the user to change it).

Create an attacking system that gives a percentage chance to the player and character that takes one from their health if hit.

If the player dies, the game ends. If the other character dies, their items are dropped in the room that the fight occurs in.

Create a Dynamic Map
way to hecking hard surely Create a map which displays the users location and where they have been in relation to their position.

Add Eat Command
At start of game the character is carrying an apple. Allow them to eat it. Perhaps introduce an energy property so they must eat it to continue (this seems less probable as it wouldn't make sense to alter the record structures as the files may not work).

Add Drink Command
At start of game the character is carrying a flask. There is a barrel of water. Allow them to drink from the barrel.

Add 'Fill ' Command
Allows you to fill the flask with water.

Only possible to fill empty containers, you have to have the item and be in the cellar to fill it.

If dice game is lost, allow last words
If user says certain thing for their last words they win instantly. Difficulty = Insane

Container items can be used, Items can be added and removed from containers
Modify the program such that containers, such as the barrel and the jar, can have items placed inside them. EDIT: THE PYTHON CODE FOR THIS DOES NOT WORK! SOMEONE PLEASE FIX.

For example,  would trigger the program to prompt for an item to be put into the barrel.

Make Torch A Container
Make the torch a container and create batteries. The torch can only be turned on 'used' when it is powered. It is only powered when the batteries are in there. SM HGS, Difficulty: Berserk

Create 'teleport item' command
Create a function to teleport any item to your location, even if it is another characters inventory SM HGS, Difficulty: Raging Terror

Create a 'move counter' and 'command history list'
SM HGS, Difficulty: Nightmare

Search/display the current directory for available games (to make the beginning less confusing for first time user
Searches and displays available games. Useful for making the beginning of the game obvious.. SM HGS Difficulty: Legendary

If user inputs invalid command 5 times the game tells the user and ends the game.
SM HGS, Difficulty: Very Easy

If the user loses the dice game they can choose what item to give up rather than a random item
SM HGS, Difficulty: Medium, Edit: Just put up my code for the VB.net section but never uploaded to this site before so hopefully I've done everything right :D

Type 'debugchar' to display the details of all characters in the game
Displays the ID, name, description and current location of each character in a list. Based off of a ZigZag education question. Useful if trying to add new characters into the game. SM HGS, Difficulty: Merciless

Adding a give procedure
This procedure allows the player to give one of their items to the guard Question: Why would you want to give anything to the guard. This serves no purpose if nothing happens after.

Add a 'look' command
Incorporate an additional command 'look', which could be used instead of 'go' in order to preview a location, assuming 'go' wouldn't have been blocked by a closed door (ZIGZAG Ex. QUESTION)

Add a 'put' feature
This means items can be placed in containers, currently items can only be taken from containers. (ADD THIS TO THE CONTAINER QUESTION)

Add a 'pick' lock feature
This allows the user the ability to try and pick the locks to one of the cell doors, however if they are caught they will instantly lose the game.