Skip to content
MilkyWay90 edited this page Oct 29, 2018 · 3 revisions

Dots is all about coding in dots, but the number of dots you need to do something is sometimes unclear because there is no documentation on this AT ALL. But now there is!

There are eight commands: RIGHT (000), LEFT (001), INC (010), DEC (011), LOOP_START (100), LOOP_END (101), GETC (110), PUTC (111) Currently, the RIGHT command doesn't work.

For this tutorial, we will learn about the INC, DEC, RIGHT, LEFT, GETC, and PUTC commands.

Before we get to that, we must learn about pointers.

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

P

Think of the pointer as a robot. It examines the number in front of it and can change it.

For example, the INC command increments the number the "robot" is examining

So if the tape of numbers and the position was this:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

P

Then it would change to this (if the INC command was applied):

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

P

The greatest/least number the number can be is 256/-256.

Now let's give a list of what the commands do:

RIGHT (000): Moves the pointer one forward.

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

P

would change to:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ....

| P

Note that if the pointer is at position 29999 (if the starting position is 0), then you cannot move right anymore.

LEFT (001): Moves the pointer one backward

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

| | P

would change to:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ....

| P

Note: if the pointer is at position 0, then you cannot move it left.

Dec (011): Decrements (subtracts 1) the number in front of the pointer.

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

P

would change to:

-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ....

P

Clone this wiki locally