[Tutor] How to only give the user so much time to enter response?

Alan Gauld alan.gauld at btinternet.com
Sun Mar 15 09:57:30 CET 2009


"james carnell" <jimcarnell at yahoo.com> wrote 

> Trying to use Timer in console based game that gives the user 
> so much time to act. 

Thats quite tricky in standard console mode.
If you were on Linux (or MacOS?) you could use curses 
and I think it would be easier there. But on XP I think
you may have to get into the world of threads and launch 
the input prompt in a separate thread which can be 
terminated after the timeout.

Its one of those things that is easier in a GUI than in a console.

HTH,


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list