Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Activity timer / chess clock

by jdavidboyd (Friar)
on Nov 04, 2002 at 19:57 UTC ( #210268=note: print w/replies, xml ) Need Help??


in reply to Activity timer / chess clock

Well, usually, a chess clock resets every time you use it. This just keeps incrementing from where you stopped it last time.
I think you need some code in activate() to reset the timer, (if you want to use it as a chess clock).
For tracking time spent working on jobs, it makes perfect sense to simply increment each timer when you switch to it.

Replies are listed 'Best First'.
Re: Re: Activity timer / chess clock
by rinceWind (Monsignor) on Nov 05, 2002 at 00:10 UTC

    Activate() is called whenever the move changes from black to white to black. When white completes a move, he presses the button, and his clock stops, but black's clock starts ticking, carrying on from where it left off.

    In tournament chess, you have, for instance, 2 hours to make the first 30 moves. The clock for white will show the total time used by white to make his moves so far. If this exceeds 02:00:00 before move 30, he has lost the game.

    The idea with using this app as a chess clock, is that once you have set up the buttons for White and Black, you save these into a file, say chessclock.ini. Now, every time you need a chess clock for a match, open chessclock.ini - save as something else if you want, and the times are reset to 00:00:00.

    Hope this helps

      Oops, my mistake.
      I thought that chess timers were more unitary.
      I mean, I thought that you had three (or two) minutes for each move, and every time you pressed the button the timer was reset to 0.
      I learn something new every day! Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://210268]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2022-05-27 01:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (94 votes). Check out past polls.

    Notices?