Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to debounce a button?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
T.O




PostPosted: Tue Jun 09, 2009 8:07 am   Post subject: How to debounce a button?

What is it you are trying to achieve?
see topic


What is the problem you are having?
see topic

Describe what you have tried to solve this problem
everything


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


Turing:


    loop
        Mouse.Where (mousex, mousey, button)
        locatexy (10, 10)
        put mousex, " ", mousey, " ", button, " " ..


        delay (30)
        if mousex > 32 and mousex < 64 and button = 1 then
            guessing (a, 1) := guessing (a, 1) + 1
        end if
        if guessing (a, 1) > teams then
            guessing (a, 1) := 1
        end if

        delay (30)
        if mousex > 69 and mousex < 101 and button = 1 then
            guessing (a, 2) := guessing (a, 2) + 1
        end if
        if guessing (a, 2) > teams then
            guessing (a, 2) := 1
        end if

        delay (30)
        if mousex > 104 and mousex < 135 and button = 1 then
            guessing (a, 3) := guessing (a, 3) + 1
        end if
        if guessing (a, 3) > teams then
            guessing (a, 3) := 1
        end if

        delay (30)
        if mousex > 139 and mousex < 168 and button = 1 then
            guessing (a, 4) := guessing (a, 4) + 1
        end if
        if guessing (a, 4) > teams then
            guessing (a, 4) := 1
        end if

        % output results



Please specify what version of Turing you are using
4.1.1



mastermind v 29 gui.t
 Description:
this is the full code

Download
 Filename:  mastermind v 29 gui.t
 Filesize:  25.75 KB
 Downloaded:  94 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: