Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <algorithm>
- #include <iomanip>
- using namespace std;
- void setupDoors(char &door1, char &door2, char &door3)
- {
- int number = rand() % 3;
- if (number % 2 == 0)
- door1 = 'G';
- else
- door1 = 'C';
- number = rand() % 3;
- if (number % 2 == 0)
- door2 = 'G';
- else
- door2 = 'C';
- number = rand() % 3;
- if (number % 2 == 0)
- door3 = 'G';
- else
- door3 = 'C';
- }
- void pickDoorChoices(char door1, char door2, char door3, int &doorPlayer, int &doorMonty)
- {
- if (door1 = 'G')
- cout << "GOOOOOOOOAT" << endl;
- }
- int main()
- {
- char door1, door2, door3;
- int count = 0, count2, doorPlayer = 0, doorMonty = 0;
- cout << "How many trials?" << endl;
- cin >> count2;
- while (count <= count2)
- {
- setupDoors(door1, door2, door3);
- cout << "Door 1: " << door1 << endl << "Door 2: " << door2 << endl << "Door 3: " << door3 << endl;
- pickDoorChoices(door1, door2, door3, doorPlayer, doorMonty);
- count++;
- }
- //cout << "Proportions" << endl;
- //cout << "Cars: " << ccount << endl;
- //cout << "Goats: " << gcount << endl;
- //cout << "Car total is " << (ccount / ((double)count * 3)) << endl;
- //cout << "Goat total is " << (gcount / ((double)count * 3)) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement