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
|
int GetGuess ( )
{
int const CARDS=18;
std::string deck [CARDS]={"red circle","red square","red triangle","blue circle","blue square",
"blue triangle","yellow circle","yellow square","yellow triangle","orange circle",
"orange square" ,"orange triangle","purple circle","purple square",
"purple triangle","green circle","green square","green triangle"};
int answer=0;
int i;
std::string color, shape,combo;
cout<<"Please choose a card with a color first, and then a shape.";
cin>>color>>shape;
combo= color + " " +shape;
for (int i=0;i<CARDS;i++)
{
if (combo==*(deck+i))
{
combo=i;
break;
}
}
return (combo);
}
|