
-----------------------------------
GobinG
Fri Jan 13, 2012 7:15 pm

Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
What is it you are trying to achieve?


-----------------------------------
Dreadnought
Fri Jan 13, 2012 10:07 pm

Re: Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
So basically the equals button doesn't work.
*looks through uncommented code to find which line handles mouse clicks on the equality button*
elsif x > 750 and x < 820 and y > 140 and y < 70 then
Think carefully about what the conditions are. Will these conditions ever all be true at the same time?

As well as the addition operation. 
*more searching through uncommented code*
elsif x > 660 and x < 730 and y > 70 and y < 140 then
    op := "+"
elsif x > 660 and x < 730 and y > 250 and y < 320 then
    op := "*"
    exit
Why does the multiplication button work and not the addition button? What is different in the code?

I realize I'm being overly critical of your comments (or lack thereof), but if you want someone to help you, adding a few comments help a lot. (It may even help you realize what's wrong on your own)

-----------------------------------
GobinG
Fri Jan 13, 2012 11:01 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
Sorry about that. Thanks for commenting though. As for the equality button I found the mistake thanks to you, it was a careless mistake by me. The code was, 

elsif x > 750 and x < 820 and y > 70 and y < 140 

As for the addition button I still don't see a difference in the code. 

BTW, thanks for hinting the answer instead of telling me, it helps.

-----------------------------------
Dreadnought
Sat Jan 14, 2012 1:56 pm

Re: Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
As for the addition button I still don't see a difference in the code. 

elsif x > 660 and x < 730 and y > 70 and y < 140 then
    op := "+" % 1 line of code
elsif x > 660 and x < 730 and y > 250 and y < 320 then
    op := "*"
    exit % 2 lines of code

-----------------------------------
Raknarg
Sat Jan 14, 2012 3:02 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
You just werent paying attention when you wrote the if statement. You said the upper boundary is 70 and the lower boundary is 140. Therefore, for the button to work, the mouse has to be above 140 and below 70 at teh same time.

-----------------------------------
mirhagk
Sat Jan 14, 2012 3:10 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
@racknarg, um no it doesn't. It must be greater than 70 and less than 140.

-----------------------------------
Tony
Sat Jan 14, 2012 3:22 pm

Re: Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
used to be
*looks through uncommented code to find which line handles mouse clicks on the equality button*
elsif x > 750 and x < 820 and y > 140 and y < 70 then
Think carefully about what the conditions are. Will these conditions ever all be true at the same time?
Though I guess that particular one had already been pointed out and fixed.

-----------------------------------
Velocity
Sat Jan 14, 2012 3:31 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
This is your culminating? I wish my culminating was this easy.

-----------------------------------
Raknarg
Sat Jan 14, 2012 4:47 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
Varies between teachers. I don't think there is any specific curriculum for compsci, because so far I've seen 5 grade ten compsci classes doing totally different things.

-----------------------------------
mirhagk
Sat Jan 14, 2012 4:57 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
there is one. You must learn what variables and if statements are, that's about it lol. Oh other then the stupid stuff about the environment and jobs and crap.

-----------------------------------
Raknarg
Sat Jan 14, 2012 5:13 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
oh yeah, we only did that part for two weeks, then we went on to turing for the rest of the semester. I actually learned a lot that whole year, I had a good teacher luckily

-----------------------------------
GobinG
Sat Jan 14, 2012 5:24 pm

RE:Broken Calculator Game Problem PLEASE HELP!
-----------------------------------
Thanks for replying guys. As for the culminating, it was our choice of either making a game of our choice or some storybook. So I choose the game. 

Thanks Dreadnought again, I fixed the problem. Just some more careless mistakes by me.

Now some how I have to figure out how to make the calculator do problems like 2 * 3 + 2. And how to make the AC Button function like it's supposed to be in a real calculator.
