Each Raspberry Pi comes with the Squeak version of the Smalltalk programming language. Well almost, most of what you need it there, but there are a few bits to collect from the internet to complete the package. Run these commands from a terminal shell to get them...
mkdir squeak-downloads; cd squeak-downloads
unzip -j Squeak-4.4-All-in-One.zip "**Squeak4.*.image"
unzip -j Squeak-4.4-All-in-One.zip "**Squeak4.*.changes"
sudo mv SqueakV41.sources /usr/share/squeak
sudo mv Squeak4.*.image /usr/share/squeak/
sudo mv Squeak4.*.changes /usr/share/squeak/
Starting SqueakNow you can start up Squeak, you'll find it in the programming menu, and open a new Workspace from the Tools menu. This is where you can execute commands with immediate effect.
Type in the line below and execute it by bringing up the right mouse menu, or pressing Ctrl-D (for 'do it').
b := BouncingAtomsMorph new openInWorld.
You should see a panel with some bouncing atoms in it. Now try each line below, running each one in turn:
When you've had enough you can kill the morph by Alt-Clicking it and choosing the X icon, or type `b delete`
Drawing with a PenNow type in the following:
p := Pen new.
p goto: 300@300.
p squareNib: 4.
p spiral: 200 angle:45.
Select all the lines (Ctrl-A), right click and choose 'do it' from the menu. You should see a nice rainbow spiral.
What just happened? You created a new `Pen` and sent it some messages:
- to go to a point some way into the middle of the screen
- that you want a square nib of width 4 pixels
- to put the pen down ready for drawing
- to draw a spiral with 200 segments turning 45 degrees at each step.
A few things to notice:
- messages that take a parameter, e.g. `p goto: 300@300` have a colon after the message name, this style is repeated if you need to supply multiple parameters.
- each Smalltalk expression ends in a dot '.' -- don't forget this otherwise Smalltalk will join your lines together and you'll get strange error messages.
- for more info on Syntax see http://en.wikipedia.org/wiki/Smalltalk#Syntax
Sound doesn't work in Squeak without a bit of tweaking. Here's what I tried first:
FMSound bass1 play.
...nothing. But there's a solution here: http://raspberrypi.stackexchange.com/a/13221/12203
What next?You could try creating some Fractal Trees.
If the above has got you interested, a good place to learn more is the free book: http://squeakbyexample.org/