Author | Message |
---|---|
lakerfan94
Posts: 143
|
Posted 18:12 Sep 29, 2015 |
For the lab where we have to assure that the guess function is only called once on each move, I'm having an issue. What I decided to do was declare a variable that would hold the guess. In the guess function, I used the set function to set the value for that variable to be the value according to the formula we used in class. The start function, I left it as we did in class. Also, the initial lower and upper bounds(1 and 100 respectively), I still have them there. When I call the start function, the bounds are changed to the correct ones according to the arguments I pass and the correct quotient is given. However, my variable's value is not equal to the quotient. For example, if I passed the arguments 36 and 10 to the start function, the guess I acquire is 23. But yet my variable to hold the guess has 50. For some reason, that variable is using the initial bounds of 1 and 100. Also, I don't have to call any function and when I've checked the value of my variable, its value is 50. I know I've said a lot but I just want to provide as many details as possible. Can someone help me? Last edited by lakerfan94 at
18:14 Sep 29, 2015.
|
lakerfan94
Posts: 143
|
Posted 18:43 Sep 29, 2015 |
Never mind. I figured out the issue |