During my web developper training course at the Wild Code School, I've been asked to code a simple black-jack game in Java to practice the basics.
There are two players: the Player (us), and the Dealer (a bot). Each player will draw two cards, turn by turn, starting by the Player. When the Player's turn ends, the addition of the two cards are added to his current score (itinialized to 0). When the Dealer plays, only one of its cards is revealed, and the other one is face-down. The Player has to decide if he continues to draw cards or not for trying to get as close as possible to the score 21 without exceeding it.
If the Player's score exceeds 21, he loses even if the Dealer exceeds 21 too.
If the Dealer exceeds 21 and the Player doesn't, the Player wins.
If the final score of the Player is higher than the Dealer's one without exceeding 21, the Player wins.
If an Ace is drawn, the Player can decide is a 1 or a 11 is considered.
Faces cards (Jack, Queen and King) are all worth 10.