|
In case these are of any use to anyone:
1. There was not a morphic scripting Tile for doing simple 'while' loops, so I have implemented one.
It is in SqueakMap and it is called: WhileLoopForMorphicScripting.
2. Due to a lack of availability of reasonable demonstrators, I have implemented a CalculatorMorph as a demo application (also in SqueakMap).
3. I found it irritating that it is not easy to write very simple straightforward morph code in workspaces (see the example below) or to write methods rather than scripts - you have to know about players and costumes and do idiocyncratic things like call 'assuredPlayer'. While this is ok for serious programming, it is clumsy for the initial teaching of Smalltalk.
What I wanted was something that is like traditional turtle programming in traditional (Seymour Papert type) Logo. To get around the problem have written a TurtleMorph (also on SqueakMap). It is somewhat irreligious (it traps doesNotUnderstand) but it does mean that you can do each of the following couple of lines (and execute them one at a time) without getting an error (apart from setting X to be a global variable of course):
X := TurtleMorph new openInHand
X forward: 99
The reason this is an issue is that you will get an error if you do the same with a standard morph. Try:
X := EllipseMorph new openInHand.
X forward: 99
Morphic scripts put their code into a 'player' which is also not very obvious for simple programming - with TurtleMorph you can put methods into the TurtleMorph class.
I got shot-down when I suggested that all morphs should behave this way (costumes and players are important at a deeper level and doesNotUnderstand is unethical (although fun sometimes)). However, I see no problem in having a TurtleMorph that gets round this. If anyone has a better solution please tell me where I have gone off-track.
Thanks.
|