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

Username:   Password: 
 RegisterRegister   
 my program...help pls
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
air_force91




PostPosted: Tue Nov 25, 2003 1:39 pm   Post subject: my program...help pls

ok well...this is a simple project...im not done yet...i need help with something:

code:
%declare variables
    var winID:int
    var today:string
    var num1,num2,num3:int

%assign a value to WinID
    winID:=Window.Open("position:top,center,graphics:640;640")
    colorback(26)
    cls
   
    colour(10)
    put "How are your today?"
    get today
   
    if today="fine"then
        put "Me too! So let's start!"
       
    elsif today="not good"then  %can put "not good"
        put "Maybe you will hit the jackpot today! "..
        put "Then you will be happy."
       
    elsif today="great"then
        put "That is nice to hear. Let's start!"
       
    else
        put "I want to start the game now."
       
    end if
    delay(1000)
    cls   
%"for" statement for three numbers"
    put "Alright. You will now pick three one-digit numbers."..
    put " Good Luck!"
    put " "
   
    delay(500)
   
    put "Enter the first number:"
    get num1
    cls

    colour(99)
    put "The first number you have picked is: ",num1
    put " "
    delay(1000)
   
    put "Enter the second number:"
    get num2
    delay(1000)
    cls
   
    colour(77)
    put "The second number you have picked is: ",num2
    put " "
    delay(1000)
   
    put "Enter the third number:"
    get num3
    delay(1000)
    cls
   
    process siren
                       loop
                for i : 60 .. 3000 by 100
                    Music.Sound ( i, 50 )   % Sound note
                end for
                for decreasing i : 2900 .. 200 by 100
                    Music.Sound ( i, 50 )   % Sound note
                   
             
                end for
            end loop
        end siren
       
        fork siren
       
%numbers being processed
   
    put "|",num1,            "|"
   
    delay(500)
    locate(1, 1)
   
    put "|",       num2,     "|"
   
    delay(500)
    locate(1, 1)
   
    put "|",            num3,"|"
   
    delay(500)
    locate(1, 1)
       
        if num1>5or num2<6and num2>=9then
       
           
                       
         
            put "Ladies and Gentlemen, "..
            put "we have a WINNER!"
         
        else
            put "Game over. You lose!"
       
           
       end if     
           


ok....u know the loop part...with the sound...well...what if i want to end it after lets say a few seconds...after the winner is announced and then i want to clear the screen and do something else....in another words i want the loop to end in a few seconds and move onto something else...how could i do that? do u have any other suggestions that i could include in my assignment...??thanx... Smile
Sponsor
Sponsor
Sponsor
sponsor
air_force91




PostPosted: Tue Nov 25, 2003 1:41 pm   Post subject: (No subject)

code:
%numbers being processed
   
    put "|",num1,            "|"
   
    delay(500)
    locate(1, 1)
   
    put "|",       num2,     "|"
   
    delay(500)
    locate(1, 1)
   
    put "|",            num3,"|"
   
    delay(500)
    locate(1, 1)


here i wanted multiple numbers to change...u know...like in matrix...but i don't know how to...is there an easy way to make the effect?
Dan




PostPosted: Tue Nov 25, 2003 5:03 pm   Post subject: (No subject)

as for the matrix thing a quick sreach of turing secion whould get you: http://www.compsci.ca/v2/search.php?mode=results

the top ones on that are full code for matrix effect in turing.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Dan




PostPosted: Tue Nov 25, 2003 5:09 pm   Post subject: (No subject)

as for the loop thing, if you replace the loop with a for loop then you can set it how may times it will run and it should stop once it has run that many times.

to clear the screen use cls
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
FDisk87




PostPosted: Sat Dec 06, 2003 4:52 pm   Post subject: (No subject)

so the point of this game is to enter a number that is greater than 5, then one that is less than 6, then greater than or equal to 9?
air_force91




PostPosted: Sat Dec 06, 2003 8:53 pm   Post subject: (No subject)

nah...well...it was supposed to be a guessing game but it didn't work out...i could've worked it out if i had another day to work on the bonus project... Confused but oh well...it's done...my class is on the unit on interfacing...
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  [ 6 Posts ]
Jump to:   


Style:  
Search: