#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
int players;
int input;
cout << "Welcome to the Fish Die game!";
cout << "Press 1 for rules, or 2 to start the game.";
cin >> input;
if(input == 1)
{
cout << "The rules are simple! Pick 3 dice out of the cup, then roll!\nEach fish you roll counts as 1 point,\n";
cout << "Each boot you roll counts as a strike, and any hooks can be rerolled. Each roll set aside any fish and boots. ";
cout << "and reroll 3 die again.\n The first to 12 fish wins. If you get 3 boots, you get 0, and your turn is over.";
}
else
{
cout << "How many players will there be?\nEnter a number greater than 2\n";
}
while(players >= 2 && players <= 12)
{
cin >> players;
cout << "Please enter a valid number";
}
}
void roll()
{
srand (time(0));
int s;
to start, the end brace of the else should be just before system("pause"); and not before the while
second you don't need loop to get one number, the code
1 2 3 4 5 6
while(players >= 2 && players <= 12)
{
cin >> players;
cout << "Please enter a valid number";
}
needs to be
1 2 3 4 5
do
{
cout << "Please enter a number between 2 and 12" << endl;
cin >> players;
}while( players < 2 || players > 12)
at this point run a loop for all players, in this loop use random to determine the face and depending on the face run a loop (for roll again etc) or give next user the chance.
Hope this helps you get going