Skip to content

renzofbn/21

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

21 🤟

A pure javascript game. 21 is a blackjack game, where the player has to get as close as possible to 21 without going over. The game is played against the computer, and the player can choose to get more cards or stand. The game is over when the player decides to stand or when the player goes over 21.

Preview Gif

Game rules 📜

You must get 21 to win (well, that's a bit obvious).

Every new game, you will receive 2 cards and Dealer(AI) 2 cards as well but one upside down. When you press the get card button, you'll get yourself another card. Be careful and do not go over 21, if you feel you are not going to get to 21. You can play safe and stop, with the stop button.

Especial values for certain cards

  • J, Q and K have a value of 10, all other cards are worth what they say, except one (Ace).
  • Ace has two possible values, 11 or 1. The value can change in your favor, more than once.

Don't worry about the Ace worth, the game will get the best worth for you.

These blackjack rules may be different from others, I have tried to keep them simple, because simple is best. Have fun :

Development 🛠️

This game was developed using this technologies:

Html5 Css Js Bootstrap

All the logic of the game is in the assets/js/game.js file, and the game is rendered in the index.html file using its min version game.min.js.

This game also uses underscore.js for some logic, and bootstrap for the styles.

You can found about the game logic in the assets/js/game.js file.

License 📄

This project is under the License (MIT) - see the file LICENSE.md for details.