Advertisement
ninepintcoggie

Untitled

Mar 1st, 2015
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. void setupDoors(char &door1, char &door2, char &door3)
  10. {
  11. int number = rand() % 3;
  12. if (number % 2 == 0)
  13. door1 = 'G';
  14. else
  15. door1 = 'C';
  16. number = rand() % 3;
  17. if (number % 2 == 0)
  18. door2 = 'G';
  19. else
  20. door2 = 'C';
  21. number = rand() % 3;
  22. if (number % 2 == 0)
  23. door3 = 'G';
  24. else
  25. door3 = 'C';
  26. }
  27.  
  28. void pickDoorChoices(char door1, char door2, char door3, int &doorPlayer, int &doorMonty)
  29. {
  30. if (door1 = 'G')
  31. cout << "GOOOOOOOOAT" << endl;
  32. }
  33. int main()
  34. {
  35. char door1, door2, door3;
  36. int count = 0, count2, doorPlayer = 0, doorMonty = 0;
  37. cout << "How many trials?" << endl;
  38. cin >> count2;
  39. while (count <= count2)
  40. {
  41. setupDoors(door1, door2, door3);
  42. cout << "Door 1: " << door1 << endl << "Door 2: " << door2 << endl << "Door 3: " << door3 << endl;
  43. pickDoorChoices(door1, door2, door3, doorPlayer, doorMonty);
  44. count++;
  45. }
  46.  
  47. //cout << "Proportions" << endl;
  48. //cout << "Cars: " << ccount << endl;
  49. //cout << "Goats: " << gcount << endl;
  50. //cout << "Car total is " << (ccount / ((double)count * 3)) << endl;
  51. //cout << "Goat total is " << (gcount / ((double)count * 3)) << endl;
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement