Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Author Message
kevin_zullu@hotmail.com

Posted: Fri Nov 19, 2010 6:58 pm   Post subject: Turing Help Please !

Im trying to finish guessing game for turing this is what i have so far

import GUI
var num : int
var count2 : int := 0
var guess1 : int
var count : int := 0
var players : int
var guess2 : int
var count3 : int := 0
var count4 : int := 0
var picID: int
var ok : int
loop
setscreen ("graphics")
const message := "GUESSING GAME OMFG!!"
for i : 1 .. length (message)
color (i mod maxcolor + 48)
put message (i) ..
end for
delay (35)
end loop
put "Instructions:The goal of the game is for a player to guess the random number in the least amount of tries.When playing two players its a fight to whoever can guess it first HAVE FUN!"
procedure hello
cls
randint (num, 1, 20)

loop
put " Guess a number from 1 to 20 "
get guess1
if guess1 < 1 then
put "Invalid"
end if
if guess1 > 20 then
put "Invalid"
end if
if num = guess1 then
put "Game Over You Win!"
put "OMG"
delay (1000)
put " YOU JUST WON! "
delay (2000)
put " MUSIC TIME !"
end if
count := count + 1
if num = guess1 then
put "it took you ", count, " tries !"
put " Would you like to play again?"
cls
randint (num, 1, 20)
count := count - count
end if
exit
end if
end if
end loop
end hello

procedure hi
randint (num, 1, 20)
cls
loop
count3 := count3 + 1
count4 := count4 + 1
put " Player 1 Guess a number from 1 to 20 "
get guess1
if guess1 < 1 then
put "Invalid"
end if
if guess1 > 20 then
put "Invalid"
end if
if num = guess1 then
put "Game Over You Win!"
put "OMG"
delay (1000)
put " YOU JUST WON! "
delay (2000)
put " MUSIC TIME !"
put " PLAYER 1 WINS "
put "It took player one ", count3, " Tries and player two ", count4-1, " tries"
Music.Play ("8<d>>def+
put " Would you like to play again?"
cls
randint (num, 1, 20)
count3 := count3 - count3
count4 := count4 - count4
end if
exit
end if
end if

put " Player 2 Guess a number from 1 to 20 "
get guess2
if guess2 < 1 then
put "Invalid"
end if
if guess2 > 20 then
put "Invalid"
end if
if num = guess2 then
put "Game Over You Win!"
put "OMG"
delay (1000)
put " YOU JUST WON! "
delay (2000)
put " MUSIC TIME !"
put " PLAYER 2 WINS "
put "It took player one ", count3, " Tries and player two ", count4-1, " tries"
Music.Play ("8<d>>def+
put " Would you like to play again?"
cls
randint (num, 1, 20)
count4 := count4 - count4
count3 := count3 - count3
end if
exit
end if
end if

end loop
end hi

var button1 : int := GUI.CreateButton (250, 250, 10, "1 Player", hello)
var button2 : int := GUI.CreateButton (350, 250, 00, "2 Player", hi)

loop
exit when GUI.ProcessEvent
end loop

Now all i want to do is make it so the loop at the very start
loop
setscreen ("graphics")
const message := "GUESSING GAME OMFG!!"
for i : 1 .. length (message)
color (i mod maxcolor + 48)
put message (i) ..
end for
delay (35)
end loop

ends after a certain amount of seconds using the "time" command but i dont know how to use it . Can someone please post what im supposed to do and maybe even just finish that little part for me i would greatly appreciate that

goroyoshi

Posted: Sun Feb 26, 2012 11:37 am   Post subject: RE:Turing Help Please !

there is a turing forum, you should be posting there.
[Gandalf]

Posted: Sun Feb 26, 2012 11:56 am   Post subject: Re: Turing Help Please !

You're right, but this post is two years old, and you just resurrected it for no reason. Locked.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: