Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jasojone committed May 17, 2021
1 parent 82c7d6d commit b08f9c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Binary file modified cis17cMtP3.2/dist/Debug/Cygwin-Windows/cis17cmtp3.2
Binary file not shown.
18 changes: 9 additions & 9 deletions cis17cMtP7/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ int main ()
srand(static_cast<unsigned int>(time(0)));

int faces = 13,
loop = 600000,
count = 0;
loopCnt = 600000;

float three = 0,
four = 0,
twoPair = 0,
onePair = 0;

for(int i = 0; i < loop; ++i)
for(int i = 0; i < loopCnt; ++i)
{
vector<int> deck(13, 0);
int pairs = 0;
Expand All @@ -29,9 +28,10 @@ int main ()
deck[rand()%13]++;
}

for(int j = 0; j < deck.size(); ++j)
for(int i = 0; i < deck.size(); ++i)
{
switch(deck[j])

switch(deck[i])
{
case 2:
++pairs;
Expand All @@ -56,10 +56,10 @@ int main ()
}

cout << "Simulated Probability of Card Combinations: " << endl;
cout << "One Pair: " << onePair/loop * 100 << "%" << endl;
cout << "Two Pair: " << twoPair/loop * 100 << "%" << endl;
cout << "Three Pair: " << three/loop * 100 << "%" << endl;
cout << "Four of a kind: " << four/loop * 100 << "%" << endl;
cout << "One Pair: " << onePair/loopCnt * 100 << "%" << endl;
cout << "Two Pair: " << twoPair/loopCnt * 100 << "%" << endl;
cout << "Three Pair: " << three/loopCnt * 100 << "%" << endl;
cout << "Four of a kind: " << four/loopCnt * 100 << "%" << endl;

return 0;
}

0 comments on commit b08f9c6

Please sign in to comment.