Key being presseed before required
Author |
Message |
ipwnuha
|
Posted: Tue Apr 03, 2012 11:36 am Post subject: Key being presseed before required |
|
|
What is it you are trying to achieve?
A trivia game that is two playes where the players can "buzz" in
What is the problem you are having?
Players can hit their buzzer key before the question is asked
Describe what you have tried to solve this problem
Many things but none have worked
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
<Add your code here>
var name1, name2, answer, dummy: string
var score1, score2 : int
var c : string (1)
procedure one
cls
put "The question is..."
dummy := "Whitch of these is a RTS?"
for p : 1 .. 25
put dummy (p ) ..
delay (50)
end for
put ""
put "1. Call of Duty"
put "2. Mario"
put "3. Bioshock"
put "4. World of Warcraft"
put "5. Starcraft"
getch(c )
if c = chr (97) then
put "Good Job ",name1, " please input your answer and press enter"
get answer
if answer = "5"
then put "Correct"
Music.PlayFile ("clarinet.WAV")
score1: = score1 + 10
delay (5000)
one
else
Music.PlayFile ("Grp_boo.WAV")
put "WRONG"
put "The answer was Starcraft"
delay (5000)
one
end if
elsif c = chr (108) then
put "Good Job ",name2, " please input your answer and press enter"
get answer
if answer = "5"
then put "Correct"
Music.PlayFile ("clarinet.WAV")
score2: = score2 + 10
delay (5000)
one
else
Music.PlayFile ("Grp_boo.WAV")
put "WRONG"
put "The answer was Starcraft"
delay (5000)
one
end if
else put "somone pushed somthing wrong"
put "repeating question in 5 seconds"
delay (5000)
one
end if
end one
put "Hello, welcome to this 2 player Quiz"
put "The topic of this quiz is Video Games"
put "Please enter player 1's name"
get name1
put "Please enter player 2's name"
get name2
put "to play, when the question is displayed push your button first to answer"
put name1, ", you use A"
put name2, ", you use L"
put "the first question will start in 5 seconds"
delay(5000)
one
|
Please specify what version of Turing you are using
the turing i am using is 4.1 |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Dreadnought
|
Posted: Tue Apr 03, 2012 1:09 pm Post subject: Re: Key being presseed before required |
|
|
I'm guessing what you're looking for is Input.Flush. |
|
|
|
|
 |
|
|