# A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Skeleton code/2014 Exam/Section D
## Potential Questions
### At the end of the game the player is asked to enter their name. Currently the player can just enter nothing by pressing Return. Modify the program to disallow empty inputs.

VB.Net solution
Answer:
Modify the function GetPlayerName as follows:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Save/Load Recent scores from a file

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Ranked/Top/High Scores

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Add a new suit to the deck

VB.Net solution
Answer:
// Also in every instance of 52 or 51 add 13 to increase the deck size to accommodate another suit and add this to the text file: 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Change the objective of the game to higher or lower rather than just higher or not

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Use the suit of the card to determine if the same value card is higher or not - suits are ranked 1 to 4 as they are in Bridge - Clubs, Diamonds, Hearts, Spades

VB.Net solution
Answer:
Enter this as IsNextCardHigher
'Mr Patel 'Highdown
'More efficient version which uses ELSE
Python Solution
Answer:
* Python Solution
Please note this solution amends the existing PlayGame function rather than creates a complete new function. It does need a need function called IsNextCardLower(LastCard, NextCard)
Java solution
Answer:
Pascal solution
Answer:

### Getting the Users choice to choose if the next card will be higher will not accept capital letters. Modify the code to allow this.

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Currently there is no way to quit during the game. Allow the user to quit during the game.

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Limit the user's "username" to X characters

VB.Net Solution
Answer:
NOTE: This piece of code has also disallowed an input of 0 characters for the 'username'. Therefore the username must be between 1 and 10 characters long. Jack.Wall
Python Solution
Answer:
Note: This also has the fix for Question 1
Java solution
Answer:
Pascal solution
Answer:

### Using the previously shown cards show a percentage of the next card being higher.

Second Python solution is a less compute intensive solution than most, and works all way from 1st to last card. Easy to port to other languages 'Note: none of these solutions take into account the fact that the total cards in each rank decreases
VB.Net solution
Answer:
Python Solution
Answer:
Less Compute intensive solution every GetCard does ONE subtract, and MAX of 12 numbers to SUM to get percentage
Java solution
Answer:
Pascal solution
Answer:

### Allow the user a certain number of card swaps if they don't like the card dealt to them (Based on Bruce's "Play Your Cards Right" for those of a certain age!)

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Record the number of games played and an average score

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Give a player 2 lives. If they get it wrong they lose a life

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Replay a shuffled deck. Add a menu option to replay the last "shuffled" game.

As each card is thrown away and moved up the deck this requires changing the deck handling to include a pointer. Is this Likely?
This does not appear to be needed. You can just replay with Deck as the contents of that are not lost. There is no need for a copy of the Deck to play again.
No it doesn't. As the person who produced the Pascal solution has shown - just take a copy of the shuffled deck before you start playing. You can play this copy again and again. GetCard effectively pops card from deck and fills in a blank on bottom so destroys the deck while playing Python version available as well VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Create a gambling element where reaching a certain score earns you more money, based on a user bet.

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### The Ace could be considered as a high card or a low card. Change the value of the aces to make them the highest card.

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Allow user to save the whole game, including the current player pack and the recent scores, quit the program, then restart program and continue to play saved game/scores

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### When the card number is the same you draw and go onto the next card instead of losing.

Basically change IsNextCardHigher to become IsNextCardHigherOrEqual VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### Make a two player game. Instead of 'Game over' play passes to the other player. Last man standing when the deck is exhausted wins. Or they get 5 guesses each, top score wins./*Surely the scores will be the same if no-one's got it wrong after 5?*/ /*If so, continue*/

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### When displaying the scores sort the player names into alphabetical order regardless of score

VB.Net solution
Answer:
Python Solution
Answer:
Java solution
Answer:
Pascal solution
Answer:

### If you turn over 51 cards shuffle the deck and continue playing
## Code provided by AQA is linked here

VB.NET
Answer:
Java
Answer:
Python
Answer:
Pascal
Answer: