Computer Science Canada

code for a click counter

Author:  neverstopbelevin [ Thu Nov 18, 2010 5:17 pm ]
Post subject:  code for a click counter

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>


What is the problem you are having?
<Answer Here>


Describe what you have tried to solve this problem
<Answer Here>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>

Author:  neverstopbelevin [ Thu Nov 18, 2010 5:19 pm ]
Post subject:  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


: