-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started [WIP]
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 0
s and 1
s, 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 ;--
.
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
.