From Turtles to AtomsLet’s start by writing a simple script. We’re going to create many turtles to represent atoms within a system and make them move.
Step 1: Creating a New Breed of Turtles |
||||||||||||||||||||||
![]() |
||||||||||||||||||||||
| Wait a moment, and you’ll get a colored box at your cursor. This is the representation of the turtle breed in the world. It serves as an exemplar, or model, for all the turtles that you create from that breed. A small, colored dot (a turtle) will also appear in the Kedama world. The first breed of turtles is always red. If you create more than one turtle breed, the next colors are randomly assigned. | ||||||||||||||||||||||
![]() |
||||||||||||||||||||||
| Step 2: Setting the Number of Turtles To get new turtles, you can do one of two things, depending on what you want your turtles to do. |
||||||||||||||||||||||
|
||||||||||||||||||||||
![]() |
||||||||||||||||||||||
|
||||||||||||||||||||||
![]() |
||||||||||||||||||||||
For our simulation, we want all our turtles to behave the same way – as atoms – so we’ll use the first method. When you finish, you should see the Kedama world with many red turtles in it, all from the same breed. |
||||||||||||||||||||||
![]() |
||||||||||||||||||||||
| Step 3: Making the Turtles Move Let’s make our breed of turtles move. It’s very similar to making other objects in Squeak move, so you’re probably already an expert at this! If it’s not already open, go ahead and open the viewer for the turtle and choose the “kedama turtle” category. You should see a list of familiar commands, including “turtle1 forward by.” |
||||||||||||||||||||||
![]() |
||||||||||||||||||||||
| Pull these tiles out to create a new script. Enter how far you want the turtles to move each time, set your script running, and watch your turtles go! Congratulations – you’ve now used Kedama to make an atomic simulation. | ||||||||||||||||||||||