Experiments

sqrmax at cvtci.com.ar sqrmax at cvtci.com.ar
Tue Feb 16 18:15:46 UTC 1999


Hi.

The MorphicWrappers have an commented step method that makes them talk when 
uncommented by adding balloons to themselves. I worked on it this weekend 
and got a conversation scheduler that makes jokes, puns, and a lot of funny 
stuff. I ran into some difficulties to get what I wanted.

1. No multiple balloons.
Why is this? I added another method with the balloon removal sentence 
removed so that it won't remove the balloons, so that multiple conversations can 
go on at the same time without fighting for the only balloon available. I 
named the method addBalloon:... instead of showBalloon:...

2. No colorful balloons.
?... I modified my method to allow addBalloon:...color:. And then I also 
just sent a translucent color. Multiple multicolor translucent balloons look 
great! Each conversation has its own color so you can follow them. I found a 
nice way to generate random translucent colors for balloons: Color random 
lighter lighter alpha: 0.83.

3. Balloon problems with vertices.
Ask a morph with negative position like -positive at -positive to add a 
balloon to itself, vertices for it will be supplied empty and it will display an 
error message. Reason... ???... I haven't looked at this one too much yet.

4. Random doesn't behave as expected.
I just left the babbler running. When it wants to build a conversation, it 
gets suitable morphs, chooses one atRandom, and then sorts the rest by 
distance to the first, grabs the first 5 atRandom and those will talk together 
(hint: no shouting all over the world). Then, the conversation is built with its 
members and a list of events taken from text lists again atRandom. The color 
of the conversation will also be Color random.

Then you'll see waves of the same color, waves of the same text, waves of 
the same amount of morphs talking and waves of the same morphs talking. ???...

I also noticed this with Color random doing something else. I built a 
function plotter and at first I chose the color of each function by Color random 
as they were added. I noticed pairs and triplets of very similar colors chosen 
consecutively.

5. 0.0 raisedTo: 0.75 = -0.0.
When this is evaluated, 0.0 ln = -Infinity, then it's multiplied by aNumber 
and still is -Infinity, and then it's sent exp and the result is -0.0. Why 
-0.0 if e^anything > 0? And -0.0 can't be truncated so problems arise from 
this... would it be ok in raiseTo: to add something like

self = 0.0 ifTrue: [^0.0]

after the line dealing with 0.0 ^ 0.0? Or should the ln+*+exp thing work?


I'm using Squeak 2.3 with all updates available.

Andres.





More information about the Squeak-dev mailing list