drewrc / js-war-game

https://drewrc.github.io/js-war-game/

Home Page:https://drewrc.github.io/js-war-game/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

js-war-game

JavaScript War Game

The goal is to be the first player to win all 52 cards.

THE DEAL

The deck is divided evenly, with each player receiving 26 cards, dealt one at a time, face down. Anyone may deal first. Each player places his stack of cards face down, in front of him.

THE PLAY

Each player turns up a card at the same time, and the player with the higher card takes both cards and puts them, face down, on the bottom of his stack.

If the cards are the same rank, it is War. Each player places three cards face down and one card face up. The player with the higher card takes both piles (ten cards). If the turned-up cards are again the same rank, each player places another three cards face down and turns another card face up. The player with the higher card takes all 18 cards, and so on.

HOW TO KEEP SCORE

The game ends when one player has won all the cards.

REQUIREMENTS

You must have a constructor for Game, Player, Deck, and Card You must attach methods to the prototype chain You must create a basic UI that includes a draw button and message box that informs the game status after each draw (e.g. What cards were drawn? Which player won the hand? How many cards does each player have?)

About

https://drewrc.github.io/js-war-game/

https://drewrc.github.io/js-war-game/


Languages

Language:JavaScript 82.8%Language:CSS 9.3%Language:HTML 7.9%