1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
// go fish 2.0
#include <iostream>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<ctime>
using namespace std;
int main ()
{
int human = 1;
int scores[4];
char names[4][20];
int deck[4][13];
int current = 1;
enum asuit {hearts=1,diamonds,clubs,spades} suit;
enum acard {ace=1,two,three,four,five,six,seven,eight,nine,ten,jack,queen,king} card;
cout << "Welcome to GO FISH! I am your card shark CHAD.\n\n";
cout << "The game is case-sensitive.\n\n";
cout << "Enter the number of players: " << endl; //Set player number
cin >> human;
for (int counter=1;counter<=human;counter++) //Enter player names
{
cout << "\n\nPlease enter your name player " << counter << ":" << endl;
cin >> names[counter];
}
for (int counter=1;counter<=human;counter++)
{
while (current!=6)
{
int rone=0;
int rtwo=0;
rone = rand()%4;
rtwo = rand()%13;
if (deck[rone][rtwo]==0)
{
deck[rone][rtwo]=current;
current++;
}
}
}
return 0;
}
| |