/CARD-GAME

Primary LanguageJavaScript

WAR CARD GAME:

RULES:

War Card game Algorithm:

2 players (player 1 and player 2, 1 deck (52 cards)

  1. Shuffle the deck
  2. Separate the deck into two decks
  3. Each player holds one deck
  4. Both players reveal the top card of their decks and place them to the desk
  5. Compare players’ card value (Do not consider the color and pattern)
  6. The player who have the higher value revealed card takes both cards on the desk and place those cards facing down at the bottom of his/her own deck
  7. If player 1 and 2 revealed cards with same value, means “the war begins”
  8. When the war begins, both players put next two cards from the top of his/her own deck on the desk and reveal the second card
  9. Compare the cards’ value
  10. If player 1 second revealed card has a higher value than player 2, player 1 takes all cards on the desk, face them down and then put them on the bottom of his/her own deck
  11. If player 2 second revealed card has a higher value than player 1, player 2 takes all cards on the desk, face them down and then put them on the bottom of his/her own deck
  12. If player 1 and 2 second revealed cards still have the same value, back to No.7 step and continue. The repetition will stop until one player revealed card have a higher value than another player.
  13. The player who win the “war”, takes all cards on the desk, face them down and put them to the bottom of his/her own deck
  14. The players continue to reveal the top card of their deck
  15. The game will continue until there is winner
  16. The player who first win all 52 cards is the winner
  17. If one player is not able to complete the “war” (do not have enough cards to complete the “war”), this player loses the game, and the other player wins

My team members:

  1. Vellanki saranya
  2. Sadhana butreddy
  3. Manoj

Learning Competencies

By the end of this milestone ensure that you

  • write tests for any program you are ever going to build
  • are able to create and use object prototypes in js
  • have understood how everything is an object in js & how powerful it is
  • have practiced refactoring methods for your code
  • able to appreciate the importance of thinking of time and planning of the project
  • learn and practice a few software design patterns like Don't-Repeat-Yourself etc

Problem Statement

Playing cards have always been fascinating for mathematicians and logicians. Right from the fact that the number of card shuffles possible are more than the atoms on earth (There are 80,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 (67 zeros) ways to arrange a deck of 52 cards) to the fact that you could beat some of the biggest casinos by using high school level math; a simple deck of playing cards have always intrigued, amused and sometimes bewildered us.

Pick one card game(Solitaire, Hearts, Rummy, Cheat, BlackJack, Mahjong etc) that you want to implement. It's fine if you want to implement more than one card game. Create the full featured game as a web application that runs on any modern browser and deploy it.

Hints

  • Explore various card games and understand the logic behind each
  • Finalize a game which fascinates you the most
  • Think of game logic and write down your algorithm for handling all the edge cases
  • Break the overall project into features
  • Take care of UX and UI: Build wireframes
  • You may deploy your product on the cloud using Github Pages. Original 2048 game was actually hosted on Github Pages.

Guide

Click here to watch milestone guide