Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   Creating functions and procedures (http://www.alice.org/community/showthread.php?t=2721)

DrJim 06-03-2009 09:19 AM

Creating functions and procedures
 
2 Attachment(s)
Another observation - apparently the approach for creating changed a bit changed a bit during development (and since the early tutorial videos).

In the present version, there is one basic pull down menu (see below) for this, which seems to work fine. There are also several display options, which I haven't even begun to explore.

lanceA 06-04-2009 11:07 AM

I agree Dr. Jim that the Beta release is different. I downloaded the two Alice ScreenCasts thinking they might act as tutorials, but the released software is nothing similar to what is described in the screencasts.

Like you, it took me a while to do something as simple as create a new method (methods are now called procedures). I also stumbled across how to remove the [B][I][FONT=Courier New]this[/FONT][/I][/B] java keyword.

If I have to hunt & peck my way through learning 3.0 (beta) without documentation this summer this is no way I can introduce it in September.

Where is Dick Baldwin when we need him most!! :o

Keep posting any new revelations you stumble across as we all begin the learning process and I will do likewise. Currently I'm off to play with opening/modifying Alice worlds in NetBeans. :eek:

(It's sad that most school systems don't have the budget to pay for attending workshops this summer - but we are in an economic crisis.)

DrJim 06-04-2009 04:29 PM

[QUOTE=lanceA;10444]I also stumbled across how to remove the [B][I][FONT=Courier New]this[/FONT][/I][/B] java keyword. [/QUOTE]

How did you do that? :confused: I haven't yet figured out a way - and the problem is rather annoying.

lanceA 06-04-2009 06:20 PM

From the menus at the top of the Alice window select Window, from the drop down menu. Check "Is Omission Of This For Field Access Desired". That will remove the Java reserved word [B][I][FONT=Courier New]this[/FONT][/I][/B].

I also note that the UNDO function is not implemented in this release.

Also, when you drag a tile to the Edit window you get a mysterious message "rendering is disabled...."

Good luck and continue to post in this room. We need to know how Alice 3.0-Beta works.

Sophie 06-04-2009 11:22 PM

I find that option only works on World/scene. On the "Ground" I see
"this (a.k.a. grassyGround)" in the left panel, and "this" in the code panel. In fact (take with a grain of salt, please ... I've just been at this a few days) some things in 3.0 seem to add syntactical noise from concrete Java syntax without much apparent benefit.

Is this forum a suitable way of getting feedback / suggestions back to the development team?

[And thanks, DrJim, I even thought Add procedures/functions was missing until I saw your post!]

lanceA 06-05-2009 10:07 AM

[quote=Sophie;10470]I find that option only works on World/scene. On the "Ground" I see
"this (a.k.a. grassyGround)" in the left panel, and "this" in the code panel. In fact (take with a grain of salt, please ... I've just been at this a few days) some things in 3.0 seem to add syntactical noise from concrete Java syntax without much apparent benefit.

Is this forum a suitable way of getting feedback / suggestions back to the development team?

[And thanks, DrJim, I even thought Add procedures/functions was missing until I saw your post!][/quote]

Sophie the Java reserved word '[I][B][FONT=Courier New]this[/FONT][/B][/I]' does remain on [U]this(a.k.a.scene)[/U] but it is removed from all of my other objects, including grassyGround and any new objects that I add. And since I'm not sure what to do with this(a.k.a.scene) then I can live with it remaining on the screen. :) I have the [B]Set Locale -->[/B] English(United States).

As far as '...syntactical noise' I'm waiting on the Netbeans plugin to really see what can be done with Alice 3.0. (I saw Dennis Cosgrove talking about it in a film clip from the JavaOne conference.)

Also I think this is the forum for this type of constructive comment about the new Alice. Gabe seems to be monitoring it well. We all just need to remember the current release is under [I]heavy[/I] construction at the moment.

DrJim 06-05-2009 12:40 PM

[QUOTE=lanceA;10465] From the menus at the top of the Alice window select Window, from the drop down menu. Check "Is Omission Of [B]This[/B] For Field Access Desired". That will remove the Java reserved word [B][I][FONT=Courier New]this[/FONT][/I][/B]. [/QUOTE]

An embarrased :o thanks. Guess I should actually [I]read[/I] the menu options - but isn't that sort of like actually reading the manual, i.e., not something a macho programmer would do? :D

DrJim 06-05-2009 01:38 PM

Confused (as usual)
 
2 Attachment(s)
Just completed the attached project, which was a test of various functions. Everything seemed to work fine, but on the first call, I needed to put in a string variable (which was what the function returned).

I really don't understand what that string was supposed to do - since it's value doesn't seem to affect anything. I suspect it's some sort of a dummy, since I really haven't found anyway to just create a local parameter.

Any ideas or suggestions? :confused:

Sophie 06-07-2009 04:39 PM

Where can I find the 3.0 equivalent of 2.x "events"?

Thanks

ttkrakus 06-08-2009 11:58 PM

Pascal or Java?
 
I am getting a little frustrated with v3.0...what about those "procedures"

There is so much Java jargon in this version that seing "procedures" gives me indigestion. We have "this" and "classes" and "mouseListeners", why do you have to talk about "procedures" where such syntactical construct does not exist in Java --or was it added recently and I did not notice?

Of course, we can also argue that the "for all together" does not have a syntactically counterpart in Java either...which reinforces my view that Alice should be language independent, but this is not a popular idea in this forum.

I am a bit concerned that Alice 3.0 is getting so complex that we are going to have to learn Alice 2.X first to ease the transition to Alice 3.0!

Anyways...

ttkrakus 06-09-2009 12:31 AM

@ Confused (as usual) , Dr. Jim
 
I am also confused.
Didn't you create the Reply parameter when declaring the firstCow procedure?
You do not use the argument in your procedure, but because you declared in the procedure you, then, have to pass a string to the procedure in MyScene.run()

Am I missing something here?

DrJim 06-09-2009 09:14 AM

[QUOTE=ttkrakus;10531] Didn't you create the Reply parameter when declaring the firstCow procedure?[/QUOTE]

I did not [I]explicitly[/I] create the Reply parameter. It was automatically generated when I created the number of turns parameter to pass [B]to[/B] firstCow. Obviously since it is there, I need to pass something back - but I don't (yet) understand were it came from in the first place.

I do have a few ideas - and will post the results if they work.

Sophie 06-09-2009 03:06 PM

[QUOTE=ttkrakus;10529]There is so much Java jargon in this version that seing "procedures" gives me indigestion. .... which reinforces my view that Alice should be language independent, but this is not a popular idea in this forum.
[/QUOTE]

Amen.

I am relatively new to Alice (though quite familiar with programming, OOP, and teaching). I am excited about the new capabilities coming with 3.0 and even more apprehensive about 3.0 having an unnecessarily complex interface and steep learning curve.

To the brains behind developing Alice ... [I]please[/I] don't bog down Alice with syntax noise from Java (or anywhere else). If you want some constructs (whether from Java or not), present them the simplest way you can, please. When a new user things "I'd like to do X" make it as easy as possible for them to find the right tools to do X.

Stepping from Alice 3.0 to editing textual Java code needs to be a conscious move, and students can expect to deal with some mappings along the way.

Thanks!

Dennis Cosgrove 06-10-2009 03:49 PM

Alice3 and Looking Glass
 
Apologies for the understandable frustration.

What you are seeing today is a version of Alice that is not only under heavy construction but also has been torqued to the needs of a CS101 class. As far as “not a popular idea in this forum” nothing could be further from the truth. :) I agree with you that Alice3 in its current default incantation is far too complex (even for someone in CS101, never mind middle school). We are working on it and are far from finished.

Beyond that I would like to assure you that you need not worry about convincing us that what you have described is important.

There are multiple audiences for this system and we understand that.

Beyond just the simple customization that Alice will provide (which some of you have already started to discover) what is really exciting is continuing work of [URL="http://www.cse.wustl.edu/~ckelleher/"]Caitlin Kelleher[/URL] and her students at [URL="http://www.wustl.edu/"]WashU[/URL] on LookingGlass. (For those of you who don't know, Caitlin's dissertation work was StorytellingAlice which is the basis of Alice3.) Having seen an advance look of Looking Glass, I can tell you that you will be very pleased when it comes out.

Looking Glass goes way beyond a simple repackaging of Alice3 optimized for middle schoolers. They are already making advances in code search, debugging, and supporting students learning from existing worlds.

So to sum up, we are working together to build two separate systems which will hopefully be better than creating one system that tries to meet the needs of different audiences.

[QUOTE=ttkrakus;10529]I am getting a little frustrated with v3.0...what about those "procedures"

There is so much Java jargon in this version that seing "procedures" gives me indigestion. We have "this" and "classes" and "mouseListeners", why do you have to talk about "procedures" where such syntactical construct does not exist in Java --or was it added recently and I did not notice?

Of course, we can also argue that the "for all together" does not have a syntactically counterpart in Java either...which reinforces my view that Alice should be language independent, but this is not a popular idea in this forum.

I am a bit concerned that Alice 3.0 is getting so complex that we are going to have to learn Alice 2.X first to ease the transition to Alice 3.0!

Anyways...[/QUOTE]

DrJim 06-10-2009 05:10 PM

[QUOTE=Dennis Cosgrove;10563]
Looking Glass goes way beyond a simple repackaging of Alice3 optimized for middle schoolers. They are already making advances in code search, debugging, and supporting students learning from existing worlds.

So to sum up, we are working together to build two separate systems which will hopefully be better than creating one system that tries to meet the needs of different audiences.[/QUOTE]

Great News. :):):)

And thanks for the information. For what my opinion is worth, :rolleyes: I think you are very much on the right track.

DickBaldwin 06-10-2009 06:30 PM

Just lurking
 
[quote=lanceA;10444]

Where is Dick Baldwin when we need him most!! :o
[/quote]

Just lurking in the background, watching to see where this thing actually goes.;)

Once v3.0 becomes a reasonably stable product, I will probably write a series of tutorials on it and incorporate it into my Java courses. Until then -- since I was deemed unqualified to be a beta tester:(, I have decided to let the beta testers do the debugging.:rolleyes:

lanceA 06-11-2009 06:05 PM

[quote=DickBaldwin;10567]Just lurking in the background, watching to see where this thing actually goes.;)

Once v3.0 becomes a reasonably stable product, I will probably write a series of tutorials on it and incorporate it into my Java courses. Until then -- since I was deemed unqualified to be a beta tester:(, I have decided to let the beta testers do the debugging.:rolleyes:[/quote]

Thanks for the reply....;)

cawashburn 06-15-2009 03:46 PM

New Scenes
 
Maybe I'm missing something simple or maybe it's just the difference between working in Storytelling Alice and something that's obviously very different - but is there a way to make a new scene in Alice 3.0?

DrJim 06-15-2009 05:43 PM

[QUOTE=cawashburn;10634] - but is there a way to make a new scene in Alice 3.0?[/QUOTE]

Good question. I wondered about that myself.

At least as far as I can see, the current version hasn't implemented any way to define user classes, despite the presence of the "My Classes" folder after installation. LanceA seems to have been successful in creating new instances - but from his postings, they seem to be of existing classes.

If I'm wrong - somebody [B][I]please[/I][/B] :) clarify.

lanceA 06-15-2009 08:25 PM

[quote=DrJim;10635]Good question. I wondered about that myself.

At least as far as I can see, the current version hasn't implemented any way to define user classes, despite the presence of the "My Classes" folder after installation. LanceA seems to have been successful in creating new instances - but from his postings, they seem to be of existing classes.

If I'm wrong - somebody [B][I]please[/I][/B] :) clarify.[/quote]

Dr. Jim, so far all that I have done is create objects of existing Alice classes and this required that I import certain libraries into my code. However, I'm not sure what is meant by the users question: [U][I]"...create a new scene in Alice 3.0[/I][/U] " ? What does this mean?


Later this week I would like to create a world in Alice 3.0 using the snow template and then attempt to use NetBeans to add a new 'scene' which changes to the Grass Template while the world is running - however, I will need to spend a good deal of time studying the code for the existing world to see how Alice 3.0 can do that.

By the way, moving your Alice world to NetBeans appears to be a one-way street, you can not write Java code in NetBeans and then run your modified program in Alice 3.0 - at least I have not determined how to do this. But look at the positive side to this - Java programs run very well all over the Net!! You don't need to film your program, you just post it on the Net for all to see!

I realize this will not be appealing to many on this site who are seeking instant gratification in creating the world's next block-buster game! ;) [U]However, as a teaching tool this will be a great tool for transitioning to higher learning.[/U]

DrJim 06-16-2009 09:18 AM

[QUOTE=lanceA;10637] ...create a new scene in Alice 3.0[/I][/U] " ? What does this mean? [/QUOTE]

I had assumed (which is always dangerous) that the question refered to what you are trying to do, namely create a new "this (aka scene)" with different lights, ground, object instances, etc.

cawashburn 06-16-2009 09:35 AM

Yes, that is exactly what I was talking about - in Storytelling Alice, you can click on "Create New Scene", which brings up a new Method window and you can add a different background, characters, tripods etc. After you finish adding in the action for the new scene, you can add the "method" or scene that you just created to the bottom of the World.scene1.method and it will run after scene 1 is over.

I can't find anywhere in Alice 3.0 that allows me to create a new scene - but maybe it's called something else. It [I]did [/I]take me quite awhile to figure out that I needed to create a new procedure to make a new method. Ugh... I just got used to Alice 2.2 syntax - if Alice 3.0 didn't have so many neat features, it wouldn't bother me, but I really want the kids to be able to use 3.0. The Sims characters and actions are a huge draw for them and has generated a lot of excitement.

Dennis Cosgrove 06-16-2009 06:46 PM

Alice3 Multiple Scenes Coming Soon(ish)
 
Supporting multiple scenes is in the plans for Alice3's future. I do not have an estimate for you on when it will make it in but it is definitely a desirable feature.

[QUOTE=cawashburn;10640]Yes, that is exactly what I was talking about - in Storytelling Alice, you can click on "Create New Scene", which brings up a new Method window and you can add a different background, characters, tripods etc. After you finish adding in the action for the new scene, you can add the "method" or scene that you just created to the bottom of the World.scene1.method and it will run after scene 1 is over.

I can't find anywhere in Alice 3.0 that allows me to create a new scene - but maybe it's called something else. It [I]did [/I]take me quite awhile to figure out that I needed to create a new procedure to make a new method. Ugh... I just got used to Alice 2.2 syntax - if Alice 3.0 didn't have so many neat features, it wouldn't bother me, but I really want the kids to be able to use 3.0. The Sims characters and actions are a huge draw for them and has generated a lot of excitement.[/QUOTE]

zwhitlock 02-11-2010 11:34 PM

Choosing a "number" versus "integer"
 
I really would like to create some functions and parameters, but they require numbers that may include decimals as well. And from what I've noticed, there is only the integer option available, which does not allow things such as 3.14 to be entered.

Does anyone know what I should do?

x2495iiii 02-12-2010 01:36 AM

You can select whatever value for a number variable you want by clicking the "Other..." option at the bottom of the popup menu that appears when you click it.


All times are GMT -5. The time now is 10:03 PM.

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