Mam problem bo chce zapisac to w funkcji ale wyskakuje mi blad
int prawda;
void nazwa()
{
`int firstcard(int maximum, int minimum)
{
srand(time( NULL ) );
return rand() % (maximum - minimum + 4);
}
int secondcard(int maximum, int minimum)
{
srand(time( NULL ) );
return rand() % (maximum - minimum + 2);
}
int thirdcard(int maximum, int minimum)
{
srand(time( NULL ) );
return rand() % (maximum - minimum - 7);
}
int fourcard(int maximum, int minimum)
{
srand(time( NULL ) );
return rand() % (maximum - minimum) + minimum + 1;
}
int fivecard(int maximum, int minimum)
{
srand(time( NULL ) );
return rand() % (maximum - minimum ) + 5;
string blad = "BLAD";
switch(firstcard(54,1))
{
case 1:
cout << "AS KIER\n";
break;
case 2:
cout << "2 KIER\n";
break;
case 3:
cout << "3 KIER\n";
break;
case 4:
cout << "4 KIER\n";
break;
case 5:
cout << "5 KIER\n";
break;
case 6:
cout << "6 KIER\n";
break;
case 7:
cout << "7 KIER\n";
break;
case 8:
cout << "8 KIER\n";
break;
case 9:
cout << "9 KIER\n";
break;
case 10:
cout << "10 KIER\n";
break;
case 11:
cout << "WALET KIER\n";
break;
case 12:
cout << "KROLOWA KIER\n";
break;
case 13:
cout << "KROL KIER\n";
break;
case 14:
cout << "AS PIK\n";
break;
case 15:
cout << "2 PIK\n";
break;
case 16:
cout << "3 PIK\n";
break;
case 17:
cout << "4 PIK\n";
break;
case 18:
cout << "5 PIK\n";
break;
case 19:
cout << "6 PIK\n";
break;
case 20:
cout << "7 PIK\n";
break;
case 21:
cout << "8 PIK\n";
break;
case 22:
cout << "9 PIK\n";
break;
case 23:
cout << "10 PIK\n";
break;
case 24:
cout << "WALET PIK\n";
break;
case 25:
cout << "KROLOWA PIK\n";
break;
case 26:
cout << "KROL PIK\n";
break;
case 27:
cout << "AS TREFL\n";
break;
case 28:
cout << "2 TREFL\n";
break;
case 29:
cout << "3 TREFL\n";
break;
case 30:
cout << "4 TREFL\n";
break;
case 31:
cout << "5 TREFL\n";
break;
case 32:
cout << "6 TREFL\n";
break;
case 33:
cout << "7 TREFL\n";
break;
case 34:
cout << "8 TREFL\n";
break;
case 35:
cout << "9 TREFL\n";
break;
case 36:
cout << "10 TREFL\n";
break;
case 37:
cout << "WALET TREFL\n";
break;
case 38:
cout << "KROLOWA TREFL\n";
break;
case 39:
cout << "KROL TREFL\n";
break;
case 40:
cout << "AS KARO\n";
break;
case 41:
cout << "2 KARO\n";
break;
case 42:
cout << "3 KARO\n";
break;
case 43:
cout << "4 KARO\n";
break;
case 44:
cout << "5 KARO\n";
break;
case 45:
cout << "6 KARO\n";
break;
case 46:
cout << "7 KARO\n";
break;
case 47:
cout << "8 KARO\n";
break;
case 48:
cout << "9 KARO\n";
break;
case 49:
cout << "10 KARO\n";
break;
case 50:
cout << "WALET KARO\n";
break;
case 51:
cout << "KROLOWA KARO\n";
break;
case 52:
cout << "KROL KARO\n";
break;
case 53:
cout << "JOKER CZERWONY\n";
break;
case 54:
cout << "JOKER CZARNY\n";
break;
default:
cout << blad <<'\n';
prawda = 1;
break;
}
switch(secondcard(54,1))
{
case 1:
cout << "AS KIER\n";
break;
case 2:
cout << "2 KIER\n";
break;
case 3:
cout << "3 KIER\n";
break;
case 4:
cout << "4 KIER\n";
break;
case 5:
cout << "5 KIER\n";
break;
case 6:
cout << "6 KIER\n";
break;
case 7:
cout << "7 KIER\n";
break;
case 8:
cout << "8 KIER\n";
break;
case 9:
cout << "9 KIER\n";
break;
case 10:
cout << "10 KIER\n";
break;
case 11:
cout << "WALET KIER\n";
break;
case 12:
cout << "KROLOWA KIER\n";
break;
case 13:
cout << "KROL KIER\n";
break;
case 14:
cout << "AS PIK\n";
break;
case 15:
cout << "2 PIK\n";
break;
case 16:
cout << "3 PIK\n";
break;
case 17:
cout << "4 PIK\n";
break;
case 18:
cout << "5 PIK\n";
break;
case 19:
cout << "6 PIK\n";
break;
case 20:
cout << "7 PIK\n";
break;
case 21:
cout << "8 PIK\n";
break;
case 22:
cout << "9 PIK\n";
break;
case 23:
cout << "10 PIK\n";
break;
case 24:
cout << "WALET PIK\n";
break;
case 25:
cout << "KROLOWA PIK\n";
break;
case 26:
cout << "KROL PIK\n";
break;
case 27:
cout << "AS TREFL\n";
break;
case 28:
cout << "2 TREFL\n";
break;
case 29:
cout << "3 TREFL\n";
break;
case 30:
cout << "4 TREFL\n";
break;
case 31:
cout << "5 TREFL\n";
break;
case 32:
cout << "6 TREFL\n";
break;
case 33:
cout << "7 TREFL\n";
break;
case 34:
cout << "8 TREFL\n";
break;
case 35:
cout << "9 TREFL\n";
break;
case 36:
cout << "10 TREFL\n";
break;
case 37:
cout << "WALET TREFL\n";
break;
case 38:
cout << "KROLOWA TREFL\n";
break;
case 39:
cout << "KROL TREFL\n";
break;
case 40:
cout << "AS KARO\n";
break;
case 41:
cout << "2 KARO\n";
break;
case 42:
cout << "3 KARO\n";
break;
case 43:
cout << "4 KARO\n";
break;
case 44:
cout << "5 KARO\n";
break;
case 45:
cout << "6 KARO\n";
break;
case 46:
cout << "7 KARO\n";
break;
case 47:
cout << "8 KARO\n";
break;
case 48:
cout << "9 KARO\n";
break;
case 49:
cout << "10 KARO\n";
break;
case 50:
cout << "WALET KARO\n";
break;
case 51:
cout << "KROLOWA KARO\n";
break;
case 52:
cout << "KROL KARO\n";
break;
case 53:
cout << "JOKER CZERWONY\n";
break;
case 54:
cout << "JOKER CZARNY\n";
break;
default:
cout << blad <<'\n';
prawda = 1;
break;
}
switch(thirdcard(54,1))
{
case 1:
cout << "AS KIER\n";
break;
case 2:
cout << "2 KIER\n";
break;
case 3:
cout << "3 KIER\n";
break;
case 4:
cout << "4 KIER\n";
break;
case 5:
cout << "5 KIER\n";
break;
case 6:
cout << "6 KIER\n";
break;
case 7:
cout << "7 KIER\n";
break;
case 8:
cout << "8 KIER\n";
break;
case 9:
cout << "9 KIER\n";
break;
case 10:
cout << "10 KIER\n";
break;
case 11:
cout << "WALET KIER\n";
break;
case 12:
cout << "KROLOWA KIER\n";
break;
case 13:
cout << "KROL KIER\n";
break;
case 14:
cout << "AS PIK\n";
break;
case 15:
cout << "2 PIK\n";
break;
case 16:
cout << "3 PIK\n";
break;
case 17:
cout << "4 PIK\n";
break;
case 18:
cout << "5 PIK\n";
break;
case 19:
cout << "6 PIK\n";
break;
case 20:
cout << "7 PIK\n";
break;
case 21:
cout << "8 PIK\n";
break;
case 22:
cout << "9 PIK\n";
break;
case 23:
cout << "10 PIK\n";
break;
case 24:
cout << "WALET PIK\n";
break;
case 25:
cout << "KROLOWA PIK\n";
break;
case 26:
cout << "KROL PIK\n";
break;
case 27:
cout << "AS TREFL\n";
break;
case 28:
cout << "2 TREFL\n";
break;
case 29:
cout << "3 TREFL\n";
break;
case 30:
cout << "4 TREFL\n";
break;
case 31:
cout << "5 TREFL\n";
break;
case 32:
cout << "6 TREFL\n";
break;
case 33:
cout << "7 TREFL\n";
break;
case 34:
cout << "8 TREFL\n";
break;
case 35:
cout << "9 TREFL\n";
break;
case 36:
cout << "10 TREFL\n";
break;
case 37:
cout << "WALET TREFL\n";
break;
case 38:
cout << "KROLOWA TREFL\n";
break;
case 39:
cout << "KROL TREFL\n";
break;
case 40:
cout << "AS KARO\n";
break;
case 41:
cout << "2 KARO\n";
break;
case 42:
cout << "3 KARO\n";
break;
case 43:
cout << "4 KARO\n";
break;
case 44:
cout << "5 KARO\n";
break;
case 45:
cout << "6 KARO\n";
break;
case 46:
cout << "7 KARO\n";
break;
case 47:
cout << "8 KARO\n";
break;
case 48:
cout << "9 KARO\n";
break;
case 49:
cout << "10 KARO\n";
break;
case 50:
cout << "WALET KARO\n";
break;
case 51:
cout << "KROLOWA KARO\n";
break;
case 52:
cout << "KROL KARO\n";
break;
case 53:
cout << "JOKER CZERWONY\n";
break;
case 54:
cout << "JOKER CZARNY\n";
break;
default:
cout << blad <<'\n';
prawda = 1;
break;
}
switch(fourcard(54,1))
{
case 1:
cout << "AS KIER\n";
break;
case 2:
cout << "2 KIER\n";
break;
case 3:
cout << "3 KIER\n";
break;
case 4:
cout << "4 KIER\n";
break;
case 5:
cout << "5 KIER\n";
break;
case 6:
cout << "6 KIER\n";
break;
case 7:
cout << "7 KIER\n";
break;
case 8:
cout << "8 KIER\n";
break;
case 9:
cout << "9 KIER\n";
break;
case 10:
cout << "10 KIER\n";
break;
case 11:
cout << "WALET KIER\n";
break;
case 12:
cout << "KROLOWA KIER\n";
break;
case 13:
cout << "KROL KIER\n";
break;
case 14:
cout << "AS PIK\n";
break;
case 15:
cout << "2 PIK\n";
break;
case 16:
cout << "3 PIK\n";
break;
case 17:
cout << "4 PIK\n";
break;
case 18:
cout << "5 PIK\n";
break;
case 19:
cout << "6 PIK\n";
break;
case 20:
cout << "7 PIK\n";
break;
case 21:
cout << "8 PIK\n";
break;
case 22:
cout << "9 PIK\n";
break;
case 23:
cout << "10 PIK\n";
break;
case 24:
cout << "WALET PIK\n";
break;
case 25:
cout << "KROLOWA PIK\n";
break;
case 26:
cout << "KROL PIK\n";
break;
case 27:
cout << "AS TREFL\n";
break;
case 28:
cout << "2 TREFL\n";
break;
case 29:
cout << "3 TREFL\n";
break;
case 30:
cout << "4 TREFL\n";
break;
case 31:
cout << "5 TREFL\n";
break;
case 32:
cout << "6 TREFL\n";
break;
case 33:
cout << "7 TREFL\n";
break;
case 34:
cout << "8 TREFL\n";
break;
case 35:
cout << "9 TREFL\n";
break;
case 36:
cout << "10 TREFL\n";
break;
case 37:
cout << "WALET TREFL\n";
break;
case 38:
cout << "KROLOWA TREFL\n";
break;
case 39:
cout << "KROL TREFL\n";
break;
case 40:
cout << "AS KARO\n";
break;
case 41:
cout << "2 KARO\n";
break;
case 42:
cout << "3 KARO\n";
break;
case 43:
cout << "4 KARO\n";
break;
case 44:
cout << "5 KARO\n";
break;
case 45:
cout << "6 KARO\n";
break;
case 46:
cout << "7 KARO\n";
break;
case 47:
cout << "8 KARO\n";
break;
case 48:
cout << "9 KARO\n";
break;
case 49:
cout << "10 KARO\n";
break;
case 50:
cout << "WALET KARO\n";
break;
case 51:
cout << "KROLOWA KARO\n";
break;
case 52:
cout << "KROL KARO\n";
break;
case 53:
cout << "JOKER CZERWONY\n";
break;
case 54:
cout << "JOKER CZARNY\n";
break;
default:
cout << blad <<'\n';
prawda = 1;
break;
}
switch(fivecard(54,1))
{
case 1:
cout << "AS KIER\n";
break;
case 2:
cout << "2 KIER\n";
break;
case 3:
cout << "3 KIER\n";
break;
case 4:
cout << "4 KIER\n";
break;
case 5:
cout << "5 KIER\n";
break;
case 6:
cout << "6 KIER\n";
break;
case 7:
cout << "7 KIER\n";
break;
case 8:
cout << "8 KIER\n";
break;
case 9:
cout << "9 KIER\n";
break;
case 10:
cout << "10 KIER\n";
break;
case 11:
cout << "WALET KIER\n";
break;
case 12:
cout << "KROLOWA KIER\n";
break;
case 13:
cout << "KROL KIER\n";
break;
case 14:
cout << "AS PIK\n";
break;
case 15:
cout << "2 PIK\n";
break;
case 16:
cout << "3 PIK\n";
break;
case 17:
cout << "4 PIK\n";
break;
case 18:
cout << "5 PIK\n";
break;
case 19:
cout << "6 PIK\n";
break;
case 20:
cout << "7 PIK\n";
break;
case 21:
cout << "8 PIK\n";
break;
case 22:
cout << "9 PIK\n";
break;
case 23:
cout << "10 PIK\n";
break;
case 24:
cout << "WALET PIK\n";
break;
case 25:
cout << "KROLOWA PIK\n";
break;
case 26:
cout << "KROL PIK\n";
break;
case 27:
cout << "AS TREFL\n";
break;
case 28:
cout << "2 TREFL\n";
break;
case 29:
cout << "3 TREFL\n";
break;
case 30:
cout << "4 TREFL\n";
break;
case 31:
cout << "5 TREFL\n";
break;
case 32:
cout << "6 TREFL\n";
break;
case 33:
cout << "7 TREFL\n";
break;
case 34:
cout << "8 TREFL\n";
break;
case 35:
cout << "9 TREFL\n";
break;
case 36:
cout << "10 TREFL\n";
break;
case 37:
cout << "WALET TREFL\n";
break;
case 38:
cout << "KROLOWA TREFL\n";
break;
case 39:
cout << "KROL TREFL\n";
break;
case 40:
cout << "AS KARO\n";
break;
case 41:
cout << "2 KARO\n";
break;
case 42:
cout << "3 KARO\n";
break;
case 43:
cout << "4 KARO\n";
break;
case 44:
cout << "5 KARO\n";
break;
case 45:
cout << "6 KARO\n";
break;
case 46:
cout << "7 KARO\n";
break;
case 47:
cout << "8 KARO\n";
break;
case 48:
cout << "9 KARO\n";
break;
case 49:
cout << "10 KARO\n";
break;
case 50:
cout << "WALET KARO\n";
break;
case 51:
cout << "KROLOWA KARO\n";
break;
case 52:
cout << "KROL KARO\n";
break;
case 53:
cout << "JOKER CZERWONY\n";
break;
case 54:
cout << "JOKER CZARNY\n";
break;
default:
cout << blad <<'\n';
prawda = 1;
break;
}
}