War Card game Algorithm:
2 players (player 1 and player 2, 1 deck (52 cards)
- Shuffle the deck
- Separate the deck into two decks
- Each player holds one deck
- Both players reveal the top card of their decks and place them to the desk
- Compare players’ card value (Do not consider the color and pattern)
- 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
- If player 1 and 2 revealed cards with same value, means “the war begins”
- 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
- Compare the cards’ value
- 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
- 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
- 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.
- 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
- The players continue to reveal the top card of their deck
- The game will continue until there is winner
- The player who first win all 52 cards is the winner
- 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:
- Vellanki saranya
- Sadhana butreddy
- Manoj
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
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.
- 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.