trying to implement a timer

Discussion in 'Perl' started by fnord, Aug 22, 2003.

  1. fnord

    fnord Guest

    I've been teaching myself perl today by writing a simple word game. It's going quite well, except I've hit a wall on the timer.

    At the moment it's a simple CLI interface, and what I need to do is present the player with a list of letters, and give them 3 minutes to enter as many words as they can from the list of letters.

    I'm thinking that the easiest way to do this would be to wrap the game logic in a while() loop for the 3 minutes.

    I can't, however, find any examples of how to do this on the web or in the newsgroups.

    Can someone give me a hand?


    thanks,
    fnord
     
    fnord, Aug 22, 2003
    #1
    1. Advertising

  2. On Thu, 21 Aug 2003 20:49:41 -0400, fnord wrote:

    > I've been teaching myself perl today by writing a simple word game. It's
    > going quite well, except I've hit a wall on the timer.
    >
    > At the moment it's a simple CLI interface, and what I need to do is
    > present the player with a list of letters, and give them 3 minutes to
    > enter as many words as they can from the list of letters.
    >
    > I'm thinking that the easiest way to do this would be to wrap the game
    > logic in a while() loop for the 3 minutes.
    >
    > I can't, however, find any examples of how to do this on the web or in
    > the newsgroups.
    >
    > Can someone give me a hand?
    >
    >
    > thanks,
    > fnord


    Check out the sleep command.

    Shawn
     
    Shawn Milochik, Aug 22, 2003
    #2
    1. Advertising

  3. fnord

    Eric Frazier Guest

    Sleep doesn't help. He needs the Camel book and to look up alarm and the
    %SIG hash, there is a good example of a timer there. He wants to wait
    for input, but only for a certain amount of time. Sleep would wait, but
    not allow the program to respond to input.

    Eric

    Shawn Milochik wrote:
    >
    > On Thu, 21 Aug 2003 20:49:41 -0400, fnord wrote:
    >
    > > I've been teaching myself perl today by writing a simple word game. It's
    > > going quite well, except I've hit a wall on the timer.
    > >
    > > At the moment it's a simple CLI interface, and what I need to do is
    > > present the player with a list of letters, and give them 3 minutes to
    > > enter as many words as they can from the list of letters.
    > >
    > > I'm thinking that the easiest way to do this would be to wrap the game
    > > logic in a while() loop for the 3 minutes.
    > >
    > > I can't, however, find any examples of how to do this on the web or in
    > > the newsgroups.
    > >
    > > Can someone give me a hand?
    > >
    > >
    > > thanks,
    > > fnord

    >
    > Check out the sleep command.
    >
    > Shawn
     
    Eric Frazier, Sep 12, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    756
    Kelsang Wangchuk
    Jul 31, 2003
  2. Replies:
    1
    Views:
    1,681
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  3. Simon

    page timer, or redirect timer

    Simon, Nov 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,262
    Bruce Barker
    Nov 4, 2005
  4. Aaron Leung
    Replies:
    0
    Views:
    299
    Aaron Leung
    Dec 8, 2004
  5. Replies:
    8
    Views:
    634
    Jorgen Grahn
    Jul 15, 2013
Loading...

Share This Page