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

Username:   Password: 
 RegisterRegister   
 question about commands.......
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
recneps




PostPosted: Sat Dec 27, 2003 8:29 pm   Post subject: question about commands.......

question about commands...
i was just wondering, everyone here uses
Rand.Int
Draw.Line
..
..
etc
whereas im used to randint, drawline, etc
are they any different? more efficient? or you just like them better? lol
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Sat Dec 27, 2003 9:02 pm   Post subject: (No subject)

I don't know about it being more efficient, but for me, I use some of those because they are functions instead of procedures. Rand.Int is a function, it could be used in if statements, as part of a equation, etc, etc, more versatility I guess.

I'm not too sure about Draw.Line, I still use drawline, I don't see a difference, perhaps other than the organizational level.
Thuged_Out_G




PostPosted: Sat Dec 27, 2003 11:18 pm   Post subject: (No subject)

dont qoute me on this...i dont use it, but i believe randint is different...dont you assing a variable to it? like such

code:

randint(variable,1,10)


whereas Rand.Int you assign it to a variable

code:

variable:=Rand.Int(1,10)
Mazer




PostPosted: Sun Dec 28, 2003 7:24 am   Post subject: (No subject)

exactly.
recneps




PostPosted: Sun Dec 28, 2003 10:46 am   Post subject: k

but in essence, they are the same thing, they just have a period in the middle?
AsianSensation




PostPosted: Sun Dec 28, 2003 12:22 pm   Post subject: (No subject)

let's say you want to access a random member of your 3 dimensional array, with randint, you would have to declare three variables, and write out the thing in like alot of lines.

code:
var pos : array 1 .. 100, 1 .. 100, 1 .. 100 of int
var x, y, z : int

randint (x, 1, 100)
randint (y, 1, 100)
randint (z, 1, 100)

pos (x, y, z) := 0


with Rand.Int:

code:
var pos : array 1 .. 100, 1 .. 100, 1 .. 100 of int

pos (Rand.Int (1, 100), Rand.Int (1, 100), Rand.Int (1, 100)) := 0


see, it's easier this way.
Thuged_Out_G




PostPosted: Sun Dec 28, 2003 3:33 pm   Post subject: Re: k

recneps wrote:
but in essence, they are the same thing, they just have a period in the middle?


they are the same "in essence", they do the same thing, but i prefer Rand.Int, because you dont need to have a variable to use it, and because it can be used in equations or for loops, or just about anything involving a number

code:

for i:1..Rand.Int(2,100)
end for


code:

Draw.Line(Rand.Int(1,100),Rand.Int(100,200),Rand.Int(1,100),Rand.Int(100,200),Rand.Int(1,255))
recneps




PostPosted: Sun Dec 28, 2003 8:59 pm   Post subject: (No subject)

i see, ok. So its a newbie way with randint and expert way (you can do more with it, easier) with rand.int
AsianSensation




PostPosted: Sun Dec 28, 2003 9:51 pm   Post subject: (No subject)

recneps wrote:
i see, ok. So its a newbie way with randint and expert way (you can do more with it, easier) with rand.int


more like the lazy bum's way with Rand.Int Laughing
recneps




PostPosted: Mon Dec 29, 2003 1:41 pm   Post subject: (No subject)

lol, thats me! 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  [ 10 Posts ]
Jump to:   


Style:  
Search: