21 Game
The rules for 21 is:
- The person(s) who has 21 or is the closest to wins
- If you exceed 21 you are bust and lost
- The Jack, Queen and King cards all value at 10 points
- The Ace cards can either be 1 or 11
- if a players first 2 cards are either a Jack, Queen or King and an Ace, they automatically win
- if a player using 11 points from an Ace exceeds 21, they will not go bust until they exceed 21 again using 1 point for the Ace.
Mathematics:
The player who gets the first card has a 4/52 (1/13) chance of getting the card they want, and the more the cards get handed out the higher of a chance you will get a card you want, unless it has been handed out.
I will make sure that when the AI gets to 11 points with will be a randomised decision whether to twist or stick, and the higher the AI's points get over 11 the less chance it will to twist. e.g. if the AI had a total of 19 points the probability of it sticking would be 8/10.