diff options
author | RossTheRoss <msattr@gmail.com> | 2019-02-26 14:45:36 -0600 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-02-26 14:45:36 -0600 |
commit | c2043e1cd19e673f4a4a54685ba6f499886671fe (patch) | |
tree | eee95e9ee168bb00155b03789bad27a7294fbe2e | |
parent | Get rid of double negative (diff) | |
download | homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.tar homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.tar.gz homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.tar.bz2 homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.tar.lz homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.tar.xz homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.tar.zst homework-c2043e1cd19e673f4a4a54685ba6f499886671fe.zip |
S
s
s
-rw-r--r-- | ee1301/wk3/hw3_directory/strap012_HW3A.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ee1301/wk3/hw3_directory/strap012_HW3A.cpp b/ee1301/wk3/hw3_directory/strap012_HW3A.cpp index f83132d..b10c296 100644 --- a/ee1301/wk3/hw3_directory/strap012_HW3A.cpp +++ b/ee1301/wk3/hw3_directory/strap012_HW3A.cpp @@ -14,14 +14,14 @@ One-armed Bandit Simulator #include <iomanip> using namespace std; -// Function: spin_the_wheel +// Function: spin_the_wheels // --------------------------- // Simulates the one-armed bandit from the previous HW // d: the number of options on the spinner // w: the number of spinners // returns: Either 1 for win or 0 for loss -int spin_the_wheel(int d, int w) { +int spin_the_wheels(int d, int w) { int spinOG=0, spinNew=0, win=0; spinOG = ( (rand() % d) + 1); //Original spin is always the same w-=1; @@ -46,7 +46,7 @@ int main () { for (d=9; d<=27; d++) { winCount=0; for (long n=1000000; n>0; n--) { - int winTest = spin_the_wheel(d, w); + int winTest = spin_the_wheels(d, w); winCount+=winTest; } cout << "w=" << w << ", d=" << d |