Thank you for your help... I implemented what you said.
Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int throwCube();
int main(){
int bnkslo[6];
int number[7]={0,0,0,0,0,0,0};
int seme,throwAgain,numberCubes,changeCubes;
char izhod='d';
seme=time(NULL);
srand(seme);
do{
for(int i=1;i<6;i++){
bnkslo[i]=throwCube();
cout<< "Cube"<< i <<" = " << bnkslo[i] << endl;
}
cout<<"Throw again 0-time, 1-time, 2-time "; cin>>throwAgain;
for(int j=0;j<throwAgain;j++){ //how many times do you want to throw again
cout<<"How many Cubes do you want to throw again 1 to 5. "; cin>>numberCubes;
for(int k=1;k<=numberCubes;k++){ //how many cubes do you want to change
cout<<"Whitch Cubes do you want to change 1 to 5. "; cin>>changeCubes;
bnkslo[changeCubes]=throwCube();
for(int l=1;l<6;l++) //changing the selected cube
cout<< "Cube"<< l <<" = " << bnkslo[l] << endl;
}
}
for(int n=1;n<6;n++){ //looking for numbers
switch(bnkslo[n]){
case 1:
number[1]++;
break;
case 2:
number[2]++;
break;
case 3:
number[3]++;
break;
case 4:
number[4]++;
break;
case 5:
number[5]++;
break;
case 6:
number[6]++;
break;
}
}
cout<<"Do you want to countinue? y or n"<<" "; cin>>end;
}while(end=='y');
return 0;
}
int throwCube(){
return(rand()%6)+1; //generating random numbers from 1 to 6
}
Now the problem is kind of still there. I have the numbers that are there counted but i do not know how to use that to rank them...
I think somethink like that:
If my hand would be: 23252
That means i have :
123456
031010
now i could again whit a for loop go true the array adn use another switch to look at the array
switch(number[a])
case 1:
if(number[2]&&number[3]...)
am i on the right track or is there something else that i could do?
Thank you in advance.