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

Username:   Password: 
 RegisterRegister   
 5 player gaming program :idea:
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
viks101




PostPosted: Mon Jun 05, 2006 9:31 pm   Post subject: 5 player gaming program :idea:

need feed back on creating a 5 player gaming program in which the players have to press one of the 5 buttons before the buzzer, however if they press it before they should immediately get disqualified. How can i store the input from the user before the program goes over the if statements


GameShow.1.t
 Description:
heres what the program does roughly but not fully functional yet

Download
 Filename:  GameShow.1.t
 Filesize:  3.05 KB
 Downloaded:  55 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Mon Jun 05, 2006 10:32 pm   Post subject: (No subject)

just use your variables before your if statements ex

Turing:

Input.KeyDown(keys)
if Time.Elapsed-timeSinceLast>1000 then
put "Too quick"
else
%etc etc
end if


or else this might be something for *gulp* processes, although i would highly suggest you try different routes before you try processes Smile
TheOneTrueGod




PostPosted: Tue Jun 06, 2006 6:57 am   Post subject: (No subject)

Ugh, this is DEFINETLY not a situation for processes. The easiest way I can see to do this would be to have two loops, and to use your current method.

Pseudo Code:
code:

Randomize the time you want to wait (In milliseconds)
loop
    if they press their key now, tell them they lose, and set their respective flag to false

    exit when Time.Elapsed > TimeAtStartOfGame + RandomizedWaitTime
end loop

drawfilloval(100,100,50,50,brightred) %Cuz I like a bright light rather than small text saying "Press your button now"

do a check to make sure that someone is still in the game

%Second loop
loop
   exit when someone who wasn't disqualified presses their button.
end loop
Display the winner.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: