
-----------------------------------
neverstopbelevin
Thu Nov 18, 2010 5:17 pm

code for a click counter
-----------------------------------
What is it you are trying to achieve?



What is the problem you are having?



Describe what you have tried to solve this problem



Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)








Please specify what version of Turing you are using


-----------------------------------
neverstopbelevin
Thu Nov 18, 2010 5:19 pm

RE:code for a click counter
-----------------------------------
MY POST GOT MESSED UP ABOVE

i need to make a click counter

i have the following code, however when i run it it continues adding until i stop clicking.

for example 1..infinity.
how do i get it to count 1?


var mx, my, mb : int
var c : int := 0
loop
    mousewhere (mx, my, mb)
    if mb = 1
            then
        c := c + 1
        put c
    end if
end loop
