[Thread Prev] [Thread Next]
|
To: |
"Devon Barclay" <devonbarclay@xxxxxxxxxxx>, |
|
Subject: |
Complexity of EX and code everywhere |
|
From: |
"Daniel Ajoy" <da.ajoy@xxxxxxxxx> |
|
Date: |
Tue, 24 Apr 2007 12:44:40 -0500 |
|
Dkim-signature: |
a=rsa-sha1; c=relaxed/relaxed; |
(student project attached: "Atoms invants.mwx" )
On 24 Apr 2007 at 10:00, Devon Barclay wrote:
> Hi Daniel,
>
> What we're trying to do is make it so that when an atom hits the
> red, it sends an instruction to the atoms that have becmoe stuck
> on the colored circle allowing them to move again (the colored
> circle sets their speed to 0 when they land on it).
>
> I'd been trying to isolate all turtles with a speed of zero
> and move them, but there's a turtle (t14) that has to remain
> stationary to change the color of the circle. I think I have that
> bug fixed.
>
> Any ideas?
>
Hi Devon,
Interesting. I learned something new about EX today! :)
It seems that the instructions you give to colors, are carried out
after the rules you give to turtles.
The atoms have their OnColor:red rule programmed to carry out the
GetOut procedure. This happens before the instructions programmed
in the Color red itself are activated.
(image attached)
I turns out that the instructions programmed in the color Red
never get activated because GetOut effectively move the atoms
out of red. (actually out of the jar).
I experimented with this new content for the procedure
"getout". And discarded the instructions for red:
to getout
everyone [
if not who = "t14 [
if speed = 0 [fd 20 setspeed 0.1]
]
]
end
Now, the name "getout" doesn't make any sense. It should
be called "free.atoms.in.circle" or something to that effect.
but the rule in every atom refers to "getout" and it would be
a hassle to replace every instance of getout.
That is a reason why I like all my code to be in the procedures
tab (where I can use Search and Replace), and not scattered
around, in turtles.
I think this is a good example of the differences between
EX and Pro.
Daniel
OpenWorld Learning
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.
---- File information -----------
File: OnColorEX.gif
Date: 24 Apr 2007, 12:26
Size: 8687 bytes.
Type: GIF-image
Attachment:
OnColorEX.gif
Description: GIF image
Attachment:
Atoms invants.mwx
Description: Binary data
Previous by thread:
Logo wikis
Next by thread:
activate a project from another project
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.
|