From a65262693b1971be22030d599f9c09959be65fe8 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Sat, 23 Feb 2019 17:43:17 -0600 Subject: Fix dumb mistakes --- ee1301/wk3/hw3_directory/strap012_HW3A.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ee1301') diff --git a/ee1301/wk3/hw3_directory/strap012_HW3A.cpp b/ee1301/wk3/hw3_directory/strap012_HW3A.cpp index ce44428..7e1cfbb 100644 --- a/ee1301/wk3/hw3_directory/strap012_HW3A.cpp +++ b/ee1301/wk3/hw3_directory/strap012_HW3A.cpp @@ -15,7 +15,7 @@ One-armed Bandit Simulator using namespace std; int spin_the_wheel(int d, int w) { int spinOG, spinNew; - spinOG = rand() % d + 1 + spinOG = rand() % d + 1; for (int i=w; i>0; i--) { spinNew = rand() % d + 1 if (spinNew==spingOG) { @@ -27,13 +27,13 @@ int spin_the_wheel(int d, int w) { return 1; } int main () { - int win; + int m; int d= 3; int w= 9; for (long n=1000000; n>0; n--) { - win = spin_the_wheel(d,w); - if (win==1) { - win++; + m = spin_the_wheel(d,w); + if (m==1) { + m++; } } cout << "w=" << w << ", d=" << d; -- cgit v1.2.3