> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primastem.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PrimaSTEM and LOGO

> PrimaSTEM is LOGO turtle graphics, made physical and screen-free. Each concept on the board, with its LOGO equivalent.

PrimaSTEM is built on the idea of [LOGO](https://en.wikipedia.org/wiki/Logo_\(programming_language\)). Seymour Papert and his colleagues created this language for children in 1967. In LOGO a child types commands and a turtle draws on the screen. In PrimaSTEM the child places tokens on the board, and a wooden robot with a marker draws on paper. No keyboard, no screen, no text.

This page is for teachers who know LOGO or Scratch, and for anyone who wants to see what the tokens really do.

## Concepts on the board

| Concept | On the PrimaSTEM board | In LOGO |
| - | - | - |
| Sequence | Tokens run left to right along the top row. The LED of the running pair blinks, then goes dark | one command after another |
| Command | Forward, Back, Left, Right, Pause, Random Movement | `forward`, `back`, `left`, `right`, `wait` |
| Parameter | A number token in the same pair: Forward + 200 | `forward 200` |
| Default value | Forward with no number = 150 mm, Left/Right with no number = 90° | |
| Loop | A repeat token in the pair: Forward + repeat 4 | `repeat 4 [forward 150]` |
| Procedure | The bottom row (5 pairs) is the Function. The Function token calls it | `to shape ... end`, then `shape` |
| Procedure in a loop | The Function token and a repeat token in one pair: Function + repeat 5 | `repeat 5 [shape]` |
| Giving a procedure a value | Forward 100 moves 100 mm and saves 100. If you call a Function next that has Forward with no number, it also moves 100. Change Forward before the next call, and the same Function draws the shape in a different size | similar to `shape 100`, `shape 50` |
| Recursion | A Function token inside the bottom row: the function calls itself until you press ▶ Start again | a procedure that calls itself |
| Variables | Each command remembers its own last value: Forward, Back, Left, Right and Pause are five independent variables. Forward with no number moves as far as the last Forward | `make "step 200`, then `forward :step` |
| Arithmetic on a variable | Forward + "+30": add 30 to the saved value, then move | `make "step :step + 30 forward :step` |
| Operations | + − × ÷ √ ^ on the saved value, from −5000 to 5000, whole numbers | `sum`, `difference`, `product`, `quotient`, `sqrt`, `power` |
| Negative values | A negative result reverses the move: Forward −50 goes back 50 mm, Left −30 turns right 30° | `forward -50` |
| Randomness | The repeat token with the dice (1 to 6 times) and the Random Movement token | `random 6` |
| Pen | A marker in the centre of the robot | `pendown` |
| Debugging | Watch the robot, find the wrong token, swap it | edit the line |

Each command has its own saved value: changing Forward does not change Left. When the board is switched off, all values go back to the defaults: 150 mm, 90°, 1 s for Pause. To change the default step for good, use the "Set Default Step Length" service token (see [Device & Setup](https://docs.primastem.com/en/usermanual.md)).

The child does the calculating. The robot carries out the program exactly.

## Examples: the same program on the board and in LOGO

Each example has a link. It opens the [simulator](https://simulator.primastem.com) with this program on the board and runs it.

### Square

Board: top row Function × 4. Bottom row: Forward 300, Right.

```
repeat 4 [forward 300 right 90]
```

[Run in the simulator](https://simulator.primastem.com/#top=cfun.r004\&fn=cfor.n300,crig\&s=l1047602\&r=300-600-0\&run)

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/square-board.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=79cc88bf5f7b5d4db9bb88061625c4ee)

Program on the board

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/square-field.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=80dafb4920340e178692e358dd60a7e8)

What the robot draws

For ages 4–6, leave out the numbers: Forward and Right with no numbers draw a square with 15 cm sides.

### Equilateral triangle

Board: top row Function × 3. Bottom row: Forward 400, Right 120.

```
repeat 3 [forward 400 right 120]
```

[Run in the simulator](https://simulator.primastem.com/#top=cfun.r003\&fn=cfor.n400,crig.n120\&s=l1047602\&r=250-623-30\&run)

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/triangle-board.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=e1a7c4eacf55cfa091359c276b48cf8e)

Program on the board

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/triangle-field.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=b5f7f7a0e9200b4d766917fd10826ee7)

What the robot draws

Why 120 and not 60? The robot turns by the outer angle. The three turns together must make a full turn: 3 × 120 = 360.

### Five-pointed star

Board: top row Function × 5. Bottom row: Forward 400, Right 144.

```
repeat 5 [forward 400 right 144]
```

[Run in the simulator](https://simulator.primastem.com/#top=cfun.r005\&fn=cfor.n400,crig.n144\&s=l1047602\&r=250-405-90\&run)

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/star-board.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=638a6cc4135538f1276327c727318a6e)

Program on the board

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/star-field.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=ce0af54eb82b2fcda4555ea98890cce7)

What the robot draws

5 × 144 = 720: the robot turns around twice, and the line closes into a star.

### Circle

Board: top row Function × 36. Bottom row: Forward 25, Right 10.

```
repeat 36 [forward 25 right 10]
```

[Run in the simulator](https://simulator.primastem.com/#top=cfun.r036\&fn=cfor.n025,crig.n010\&s=l1047602\&r=438-307-90\&run)

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/circle-board.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=d2e2fb9200c7e1741fc8e48c85c8f803)

Program on the board

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/circle-field.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=14e18317e2c052773793cf82140b5340)

What the robot draws

A circle is a polygon with many short sides: 36 × 10° = 360°.

### Square spiral (variable and arithmetic)

Board: top row Forward 30, Function × 20. Bottom row: Right, Forward +30.

```
make "side 30
forward :side
repeat 20 [
  right 90
  make "side :side + 30
  forward :side
]
```

[Run in the simulator](https://simulator.primastem.com/#top=cfor.n030,cfun.r020\&fn=crig,cfor.a030\&s=l1047602\&r=450-465-0\&run)

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/spiral-board.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=1bedc4d6ad929e9edeffd61c84a62a7c)

Program on the board

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/spiral-field.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=c02f85a2d5a0c8efa2c11a9a850bca1c)

What the robot draws

Forward 30 sets the saved value. Each time the function runs, "+30" makes the side 30 mm longer: 60, 90, 120 and so on. The first Forward 30 resets the value, so if you press ▶ Start again, you get the same spiral.

### Hexagon (an angle from division)

Board: top row Right 360, Right ÷6, Function × 6. Bottom row: Forward 200, Right.

```
make "angle 360 / 6
repeat 6 [forward 200 right :angle]
```

[Run in the simulator](https://simulator.primastem.com/#top=crig.n360,crig.d006,cfun.r006\&fn=cfor.n200,crig\&s=l1047602\&r=350-232-39\&run)

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/hexagon-board.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=e22c8101803d42d659e8cf7654bf9a0c)

Program on the board

![](https://mintcdn.com/primastem/JJYOYv4iGRFfXM5x/images/logo/hexagon-field.svg?fit=max\&auto=format\&n=JJYOYv4iGRFfXM5x\&q=85\&s=fd10410c3cecd4ea9360633b81bdeeee)

What the robot draws

Right 360 makes one full turn and saves 360. Right ÷6 divides the saved value and turns 60°. In the function, Right with no number takes 60° again. The two turns at the start only change where the robot faces before it draws; the shape stays a hexagon.

The board divides in whole numbers and drops the remainder. For the shape to close, divide 360 by a number that leaves no remainder: 3, 4, 5, 6, 8, 9, 10, 12. For example, 360 ÷ 7 gives 51°, and the heptagon misses closing by 3°.

More drawings: [Drawing Examples](https://docs.primastem.com/en/mathdrawings.md).

## Where PrimaSTEM differs from LOGO

PrimaSTEM covers the core of LOGO turtle graphics. A few things work differently, by design:

* **One pair, one command and one value.** A pair of cells holds a command and at most one value: a number, a repeat or an operation. This keeps a program readable even for a four-year-old.
* **No conditions (`if`).** The program runs the same way every time. Only the dice and Random Movement add chance.
* **The Function has no named parameters.** You call it with a repeat, and it uses the values set before the call (see the table above).
* **Program length:** 6 pairs in the main row, 5 in the Function.
* **You put the marker in by hand** when the child wants the robot to draw.

When a child outgrows the board, the same robot works with [Scratch](https://scratch.primastem.com).

## Further reading

* [Seymour Papert](https://en.wikipedia.org/wiki/Seymour_Papert), *Mindstorms: Children, Computers, and Powerful Ideas*, 1980.
* [Teacher's Guide](https://docs.primastem.com/en/teachersguide.md): lessons from the first program to arithmetic.
* [Learning Guide. Book 1](https://docs.primastem.com/en/book-1/book-1.md): 12 lessons for children aged 4 and up.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.