Started the assignment one for CS396
+- assignmentOne/wordcounter.cpp +- assignmentOne/maze.cpp +- assignmentOne/go_fish.cpp +- assignmentOne/battleship.cpp
This commit is contained in:
parent
8c738f9374
commit
c8b785fcb8
4 changed files with 180 additions and 0 deletions
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue