Skip to content

Java-based Solitaire with Extra Features (Scoreboard, etc.)

Notifications You must be signed in to change notification settings

rpparas/Solitaire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solitaire

A Java-based Solitaire game built for Data Structures class. Extra features include scoreboard, etc.

Data Structures

The primary class (Solitaire) uses a Vector/ArrayList type data structure to store 52 cards. The Vector was chosen since there is a considerable reduction of cards as they are distributed to the Piles and the Stock.

The Pile (column) is instantiated seven times where each instance is stored as an array element. The Pile utilizes a LinkedList data structure to hold the shuffled cards which have been distributed to it.

The Stock uses the LinkedList data structure to hold the shuffled cards (those left after distributing to the Piles). It also uses the a stack to store the three cards drawn at a time from those shuffled. Only the top is accessible/viewable. User must use top card before any cards under it can be accessed.

The Cabinet class is instantiated four times to match the four card suits. It makes use of the stack data structure as it accumulates one card at a time and only releases the topmost card in its stack.

Conceptual design

About

Java-based Solitaire with Extra Features (Scoreboard, etc.)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published