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

Username:   Password: 
 RegisterRegister   
 Randomize Procedures?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
WesWes




PostPosted: Thu Dec 19, 2002 12:54 am   Post subject: Randomize Procedures?

I feel like an idiot, asking you dudes all these moronic questions, but I need help. I'm a fool.

How might I randomize procedures? Embarassed
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu Dec 19, 2002 1:32 am   Post subject: hummm

not 100% shure what you mean, but this is what think you whont.

code:

var num : int %var to  store ran num

%procedures
procedure hello
    put "hi"
end hello

procedure bye
    put "bye"
end bye

procedure swat
    put "swat rules"
end swat

%main loop
loop
    num := Rand.Int (1, 3) %get ran number

    %if staments to figer out wich procdure to run
    if num = 1 then
        hello

    elsif num = 2 then
        bye

    elsif num = 3 then
        swat
    end if

    delay (100) %makes it so all the output dose not go by at onec
end loop


i hope that hellped
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
WesWes




PostPosted: Thu Dec 19, 2002 9:23 pm   Post subject: (No subject)

Awesome! Thanks dude!

My program is complete!!

Thanks!!! Very Happy
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: