Project 2: The Game of Set
Set is a card game in which players attempt to find a group of cards that satisfy a particular criterion. It is a speed game: 12 cards are dealt face-up, and the players try to be the first to make a set from the visible cards. For a complete description of the game see the Wikipedia entry.
Implement this game in Ruby. Your game can be text-based (i.e., using the console). The basic, required, functionality of your game is to deal the appropriate number of cards, verify the correctness of player-identified sets, replace the identified cards with new ones, and keep track of score to identify a winner.
Optional functionality is anything that makes the game more interesting and enjoyable to play. Some examples of such functionality are:
- A timer. Racing against the clock could be appealing to some players.
- A hint generator. When players are stumped, some encouragement can be useful. Good hints require some sophistication though. For example, the dealer could announce how many different sets are available in the cards, or identify a single card that is involved in some number of sets.
- A computer player. A computer player can contribute to the game in various ways.
- Statistics. With a computer player to identify sets, one can run many (thousands of) games to empirically measure (through simulation) interesting statistics. For example, how often does a set not occur in the standard number of cards? How does this probability change with different numbers of cards turned up?
- Modes or levels. Competitive or collaborative versions are possible, or different levels of difficulty (e.g., varying number of properties)
This is not an exhaustive list of possibilities. Feel free to add whatever functionality would make your game the most interesting for people to actually play.
(If you decide to make use of a 3rd-party library for this project, see this reference for how to manage gems.)
Submission
Submit this lab by pushing a git tag to your central repository as described on the main Labs page.