Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Parameters and variables
Old
REDOS
Guest
 
Status:
Posts: n/a
Question Parameters and variables - 01-26-2010, 11:36 AM

I cant understand 100% whats the diff between this option, can u tell me plz?
   
Reply With Quote
Answer!
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default Answer! - 01-26-2010, 05:32 PM

Variables are values that can be changed and accessed. Object variables, like the world variables, can be accessed at any time, while event variables are only accessible from that event. Furthermore, if two instances of the same event are running, the variables are specific to each instance of the event.

Parameters are sort of like variables, however, they can only be made within events. These parameters are defined every time that an event is called. They can then be accessed as the event runs, and act as a sort of instruction for the event. The parameter values are deleted when an event stops. They allow you to make events more customizable.

Hope that this helps!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
Nephtysis
Guest
 
Status:
Posts: n/a
Default 01-27-2010, 03:22 PM

Quote:
Originally Posted by zonedabone View Post
Variables are values that can be changed and accessed. Object variables, like the world variables, can be accessed at any time, while event variables are only accessible from that event. Furthermore, if two instances of the same event are running, the variables are specific to each instance of the event.

Parameters are sort of like variables, however, they can only be made within events. These parameters are defined every time that an event is called. They can then be accessed as the event runs, and act as a sort of instruction for the event. The parameter values are deleted when an event stops. They allow you to make events more customizable.

Hope that this helps!

I think I understand the variable-part, as I know it from my math-classes, but those parameters I still don't really get :S If they are like variables, but with an additional limit, then why not just use the variables and leave out the parameters?
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 01-27-2010, 03:56 PM

Quote:
Originally Posted by Nephtysis View Post
I think I understand the variable-part, as I know it from my math-classes, but those parameters I still don't really get :S If they are like variables, but with an additional limit, then why not just use the variables and leave out the parameters?
Parameters aren't completely necessary. Whenever you add a parameter to an event, you can define that parameter as anything of the type specified every time that you call the event. They make the events customizable. For example, when you tell an object to move forward a certain amount, the way it handles that distance is using parameters. Anything that is set when an event is called are parameters. It's basically just a way to make your events act more like the events that are already created for you. Anything tan that you use is an event.

Hope this helps!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 01-27-2010, 05:39 PM

When he says everything tan is an event, he means that those tan codes you drag over from the object's "methods" tab, like move or turn or resize, is an event. And those white boxes that you can change to what you want, those are parameters for the event. The move event (I call them methods) can move any object you put into that box. The object is the parameter, and in the code for that move method, the object you pick will be put in for that parameter and the method will move that particular object. Also the distance is a number parameter that you can change. These are not just variables, because they are not definitively set yet. They can be changed.

Sorry if its too confusing.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Nephtysis
Guest
 
Status:
Posts: n/a
Default 01-27-2010, 06:32 PM

It seems really confusing and I'm afraid I still don't quite understand. When this week is over and my schedule is kinda back to normal I'll just go and have another look at those functions and maybe some practise will help me see it better, because now it's a bit abstract and I can't really see what the difference is between the two in regards to how you use them in a program.

(/me is no longer junior member )
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 01-27-2010, 06:57 PM

I have only been taking programming class (java) for a few months now, but I completely understand parameters because of it. Maybe you should take a programming class (if you are in high school). It has really helped me understand a lot about Alice because of the things I learned in the class so far, and on the other end Alice has taught me a lot about programming in Java.

I am planning on taking more advanced programming classes later on in high school and into college.

But anyway, if you really want to know the difference between parameters and variables, I guess you could just google it


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
Nephtysis
Guest
 
Status:
Posts: n/a
Post 01-27-2010, 07:08 PM

I'm in university and we don't have those kind of courses in high school as far as I know, but I found something of a course on Python on the net and I'm also going to learn JavaScript, whenever I can find the time for it next to my 'normal' studying :P

Thanks for the help and I'll try it a bit and put what you wrote here next to it, maybe it makes more sense then. Oh, and I did check google and on the internet it's even more abstract with 'mathematical function' stuff and 'analytical geometry' and what else..

ok, talking gibberish now, time for bed.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default 01-27-2010, 07:28 PM

Thanks for the explanation, Dameria. It's a bit hard to explain.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Thanx
Old
REDOS
Guest
 
Status:
Posts: n/a
Default Thanx - 02-10-2010, 08:42 PM

Yeah now i can understand better the use of parameters, it was kind of confusing =) thank all of u who post something here.
   
Reply With Quote
Reply

Tags
helpme, parameters, variables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.