Skip to content

This was a class project I did for my Java 1 class in college from 2009. We were giving an assignment to build a small game that played against the computer

License

Notifications You must be signed in to change notification settings

DOS1986/War-Card-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

War-Card-Game

This was a class project I did for my Java 1 class in college. We were giving an assignment to build a small game that played against the computer

I built the card game war. Using house rules which means you place 3 cards face down when war is declared instead of 1.

Objective of the game

Offical Rules:

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 their stack of cards face down, in front of them.

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 turns up one card face down and one card face up. The player with the higher cards takes both piles (six cards). If the turned-up cards are again the same rank, each player places another card face down and turns another card face up. The player with the higher card takes all 10 cards, and so on.

How to Keep Score The game ends when one player has won all the cards.

How I played when I was younger:

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 their stack of cards face down, in front of them.

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, in thier win pile.

If the cards are the same rank, it is War. Each player turns up three cards face down and one card face up. The player with the higher cards takes both piles (10 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 20 cards, and so on.

How to Keep Score The game ends when one player has won all the cards.

Things I learned while making this game

  1. Arraylist, Random(), For loop, If/else statements
  2. Writing a automation script to automate the playing of the game against the computer
  3. handling adding and removing of stirngs from string arraylists

About

This was a class project I did for my Java 1 class in college from 2009. We were giving an assignment to build a small game that played against the computer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages