53 lines
No EOL
2.2 KiB
C++
53 lines
No EOL
2.2 KiB
C++
/*
|
||
Program Name: Go Fish
|
||
Process: Does the following according to spec:
|
||
Players take turns asking their opponent for a specific card. The game will continue until all sets are
|
||
collected.
|
||
Here are the rules of the game:
|
||
● Use a 52-card deck
|
||
● Deal 7 cards to each player (human and computer).
|
||
Each play will take turns asking for a card rank/number from the opponent. If the opponent has the card
|
||
that is requested, they must hand over all the cards of that rank/number. If the opponent does not have the
|
||
card requested, then the player number “go fish” meaning they must draw a card from the deck. If a
|
||
player collects a set of four cards of the same rank, they will lay down the set and earn a point. The game
|
||
will end when all sets have been collected.
|
||
Function requirements:
|
||
● humanTurn
|
||
○ Handles the human’s turn. It will prompt the player to ask for a card rank/number and
|
||
check if the computer has the requested rank/number. If the card is available in the
|
||
computer’s hand, it will transfer the card to the human’s hand otherwise, it will draw a
|
||
card. The function should return the number of sets collected during the turn
|
||
● computerTurn
|
||
○ Handles the computer’s turn and it should do the same actions as the human but for the
|
||
computer. The function should return the number of set that is collected during its turn.
|
||
Function Input/Parameters: ???
|
||
Function Output/Parameters: ???
|
||
Function Output/Returned: ???
|
||
Device Input/Device: ???
|
||
Device Output/Monitor: ???
|
||
Dependencies: ???
|
||
*/
|
||
|
||
#include <cstdio>
|
||
#include <cstdlib>
|
||
#include <iostream>
|
||
#include <cstring>
|
||
#include <list>
|
||
#include <set>
|
||
#include <unordered_map>
|
||
#include <time.h>
|
||
|
||
using namespace std;
|
||
|
||
// function prototypes
|
||
|
||
// class definitions
|
||
|
||
// main program
|
||
int main(int argc, char **argv)
|
||
{
|
||
// return 0
|
||
return 0;
|
||
}
|
||
|
||
// compiles using "g++ -Wall -pedantic go_fish.cpp -o go_fish" - note to programmer
|