Assistance need to make a simple game

Have tried to think of how to start a solution but am still seeing stars!!! I want to design a small game that does the following:

Information available:
- 3 doors to select from
- 1 door has $ 1,000,000
- 2 doors have consolation prizes each
Information needed
- Random selection of door
- Contestant makes decision to change or stay with original choice
Result
Record wether or not the player won by remaining with original choice
Record wether player won by changing his choice.
I do not really know how to help you exactly? Where did you begin?
Btw, i really like the Monty-Hall-Problem and i like your idea.

I would save your statistic in a file. You just have to store 0s or 1s. Just record if the player would win by remaining (if yes 1 if not 0). This 'implies' your second record purpose.

The file could look like this then:

 
0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 0 ...


Then you just count how many 1s you have and divide through total and you have your approx. probability.

Maikel
Last edited on
Hi I did try to start, but things were not connecting.I was trying to make 2 functions.one is called to declare the winner, another to save details when the winner is declared.
something of the sort........ its unfinished, got headque on the way!!!

void playGame (int d1, int d2, int d3)
{
int million, consol1,sonsol2;
int winner;
d2 = million;
d1 = consol1;
d3 = consol2;
winner = d2;
if (winner != 0)
return (you won the game!)


}

int main ()
{
char door[3] = {1,2,3};
int randDoor ;
int picked_door;

/* initialize random seed: */
srand ( time(NULL) );

/* generate doors: */
randDoor = rand() % 3 + 1;

{
cout << (" Host : Please pick a door (1 to 3): ");
cin >> picked_door;
// call the function to see if this is the winner
cout << playgame (1,2,3)


if (picked_door == ) cout << ("The secret number is lower");
else if (randNumber >guess) puts ("The secret number is higher");
}


return 0;
}
Topic archived. No new replies allowed.