Skip to content

Getting Started [WIP]

Uncodeable864 edited this page May 15, 2022 · 1 revision

Your first commands

Once you've installed turing, create a file ending in .trng. This is where you will put your code. Let's look at the first two turing commands you'll need to know.

First up INIT. This command creates the "memory line". A memory line is just a list of 0s and 1s, called bits. After INIT you put the length of the memory line. If you run INIT 8 you get a memory line of 8 bits, or 1 byte.

Next up is END. END does exactly what it says, it ends the program. Once END is seen no new lines will be parsed. Keep in mind, that turing is an interpreted language, so it runs your code line by line.

FYI: If you want to add comments start the line with a //, #, or ;--.

Putting it all together

Using just these commands, we can create a template for a turing program. This template might look like this:

// Give us 16 bits (2 bytes) of memory to work with
INIT 16

END
// No more code will be run

Now, run your program in the Command Line/Terminal by simply typing in turing and dragging and dropping your file in Explorer/Finder into the window. The command might look like this: turing my/file.trng. Now, press enter! If turing tells about the program file, that means it worked! If nothing appears, something went wrong. Now on to the next section, with two more commands -- WRITE and BIT PRINT.

Clone this wiki locally