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

Username:   Password: 
 RegisterRegister   
 Higher Lower Game (perfect for nebees)
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
smith_scott_04




PostPosted: Sun Nov 16, 2003 10:35 pm   Post subject: Higher Lower Game (perfect for nebees)

Here is a game that is perfect for someone new to turing to give a try and try and expand it!!

code:

var number, guess : int

randint (number, 1, 100)

for count : 1 .. 10

    locate (1, 1)
    put "Guess a Number: " ..
    get guess

    locate (2, 1)
    if guess < number then
        put "Higher" ..
    elsif guess > number then
        put "Lower" ..
    end if

    if guess = number then
        cls
        locate (1, 1)
        put "You Win!!!"
        exit
    end if

    locate (3, 1)
    put "You Have Had ", count, " guesse(s) out of 10"

    delay (2500)
    cls

end for

cls
locate (1, 1)
put "Out of Guesses"
put "The Number Was: ", number
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: