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

Username:   Password: 
 RegisterRegister   
 Need help fixing up my CPS test on turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Abel




PostPosted: Mon Jan 22, 2024 9:35 pm   Post subject: Need help fixing up my CPS test on turing

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>



CULMINATION ASSIGNMENT!!!!!!.t2.t
 Description:
Need help to make it work man

Download
 Filename:  CULMINATION ASSIGNMENT!!!!!!.t2.t
 Filesize:  2.09 KB
 Downloaded:  46 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Superskull85




PostPosted: Yesterday at 6:37 pm   Post subject: Re: Need help fixing up my CPS test on turing

I know this an old thread but I was just checking on this site and saw this. Thought I'd take a look for a change of pace and thought maybe someone could learn from it.

Measuring time passed shouldn't be done via a delay. All that does is halt your program; while it is halted, you cannot record any clicks. You should look into the Time module and apply Time.Elapsed. You want to run the program constantly and then check if enough time has passed to deduct 1 second. I'll leave the timer logic to the reader but it tracks time in milliseconds just like when using delay.

Also, you can't measure the mouse position if you want to know if the mouse button was clicked. Additionally, waiting for a button is not what you want either. You can record the properties of all mouse activity without waiting using Mouse.Where. You should definitely read the Mouse module docs too. With that info, you can build a mouse state system using booleans to help with bad click recording. Why this happens because your program is running much faster than you can release the mouse button from the down position to the up position. So you should gatekeep when you record a new click.

Note: the updown and downup events have not proven reliable whenever I use Turing. However, I got this program running fine with a state system and the up and down events.

Finally, you should look into the View module to help reduce screen flicker and it just generally helps when you push a lot of graphical and text updates at a fast speed.


You can find the online docs at: Turing 4.1.1 Documentation
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  [ 2 Posts ]
Jump to:   


Style:  
Search: