# 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!

## Possible Section Questions
### 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
* Explain what it means if a value of -1 is returned by GetIndexOfItem. [1 mark]
* 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]
* What is the time complexity of the algorithm used to find an item in the GetIndexOfItem subroutine? [1 mark]
* 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]
* 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]
* 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]
* 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.
* 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.
Four operations that can be performed on sets are union, difference, intersection and membership.
* 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]
* 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]
* Explain why the intersection of sets F and C does not contain all the items that the player can currently get. [1 mark]
* 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.
Java:
C#:
VB.NET:
Pascal/Delphi:
Python:

## Automatically unlock and open doors

SM HGS, Difficulty: New Game +
C#:
VB.NET:
Pascal/Delphi:
Python:
Java:

## 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").
C#:
VB.NET:
Pascal/Delphi:
Python:
Java:

## 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.
VB.NET:
Pascal/Delphi:
Python:
Java:
C#:

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

Create 'help <instruction>' which lists details about individual instruction,
If just 'help' is typed, a list of existing commands appear.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Create 'teleport <location>' command

Create 'teleport <location>' command. Useful for testing game..
C#:
Delphi/Pascal:
Java:
Python:
Python method 2:
VB.NET:

## Create 'save <filename>' command

Create 'save <filename>' command. Saves the current status of game.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Add instruction to add a new character to game

Add instruction to add a new character to game. e.g. 'addcharacter <name>'
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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'.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Create new items for the game via an 'additem <name>'

Create new items for the game via an 'additem <name>' command. Useful once you have created 'save <filename>' option.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Create a new 'drop <item>' command.

Create 'drop <item>' command that drops the item selected from the user's Inventory
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Prevent guard from taking the dice if you lose

Prevent guard from taking the dice if you lose. Alternatively restart game.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Create 'time' command.

Create 'time' command. It should tell you how many minutes you have been playing. Alternative add the time (e.g. 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## Limit Inventory Size by Item Count

Limit the number of items that can be added to the inventory SM HGS, Difficulty: Veteran
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:
== 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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).
C#:
Java:
Delphi/Pascal:
Python:
VB.NET:

## 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.
C#:
Delphi/Pascal:
Java:
Python:
Python [with 'Fill <item>' command]:
VB.NET:

## Add 'Fill <item>' 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.
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## If you are in the cellar you must be carrying a torch to see items

C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## If dice game is lost, allow last words

If user says certain thing for their last words they win instantly. Difficulty = Insane
Python:
Delphi/Pascal:
Java:
C#:
VB.NET:

## 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, use barrel would trigger the program to prompt for an item to be put into the barrel.
C#:
Delphi/Pascal:
Java:
Python:

## 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
C#:
Delphi/Pascal:
Java:
VB.NET:
Python:

## 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
C#:
Delphi/Pascal:
Python:
VB. NET:

## Create a 'move counter' and 'command history list'

SM HGS, Difficulty: Nightmare
Python:
Delphi/Pascal:
VB.NET:

## 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
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## If user inputs invalid command 5 times the game tells the user and ends the game.

SM HGS, Difficulty: Very Easy
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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
C#:
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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 on a ZigZag education question. Useful if trying to add new characters into the game. SM HGS, Difficulty: Merciless
C#:
Delphi/Pascal:
Java:
Python [updated]:
VB.NET:

## 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.
Python:

## Convert the binary flag files to text files

Python:

## 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)
Delphi/Pascal:
Java:
Python:
VB.NET:

## 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)
VB.NET:

## 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.
Python: