Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Author Message
recneps

Posted: Sat Dec 27, 2003 8:29 pm   Post subject: 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

AsianSensation

Posted: 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

Posted: 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

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

exactly.
recneps

Posted: 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

Posted: 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

Posted: 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

Posted: 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

Posted: 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
recneps

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

lol, thats me!
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 10 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: