Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > trying to implement a timer

Reply
Thread Tools

trying to implement a timer

 
 
fnord
Guest
Posts: n/a
 
      08-22-2003
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
 
Reply With Quote
 
 
 
 
Shawn Milochik
Guest
Posts: n/a
 
      08-22-2003
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
 
Reply With Quote
 
 
 
 
Eric Frazier
Guest
Posts: n/a
 
      09-12-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I know about the shutdown timer, is there a "switch on" timer... Mal Carter Computer Support 3 01-12-2008 01:58 AM
page timer, or redirect timer Simon ASP .Net 1 11-04-2005 07:14 PM
System.Timers.Timer/System.Threading.Timer Not Firing At All on Dev Server james.e.coleman@gmail.com ASP .Net 1 02-22-2005 09:41 PM
How to implement autonomous timer (for FRP)? Aaron Leung Python 0 12-08-2004 10:20 PM
System.Timers.Timer vs. System.Threading.Timer Kelsang Wangchuk ASP .Net 0 07-31-2003 04:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57