Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
uglyPenguins -- lists, properties and a challenge
Old
JeremyShafer
Guest
 
Status:
Posts: n/a
Default uglyPenguins -- lists, properties and a challenge - 08-04-2008, 06:25 PM

There's nothing like an example. I've attached an example world that highlights my frustrations w/ alice.

It illustrates either A) my ineptitude or B) some deficiencies in Alice or C) a little bit of Both.

Please take a look at the uglyPenguins world. The penguins themselves are quite cute. It's the code that is ugly. All I wanted to do initially was add a "score" property to each penguin, randomly assign the score, and then display the score in a 3d text object.

I order to do this, I had to remove the scores attribute from the penguin objects, and put that in a list all it's own.

Then I wanted a way to update the scores... but you can't do that through a list. I ended up creating a very ugly method to do this.

So ... here's my challenge to the Alice community. Can someone make me an elegantPenguins that improves on this code?
Attached Files
File Type: a2w uglyPenguins.a2w (627.2 KB, 97 views)
   
Reply With Quote
 

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.