From Esolang
Jump to navigation Jump to search

ScripTur An esoteric programming language based off of turing machine theory, written by Davy Wybiral in 2007.


There are actually two parts of ScripTur that are important, the scripts which build the turing machines, and the input that becomes the tape of the turing machine. ScripTur takes a script file and builds a virtual turing machine from it, it then reads the command line argument as input for the intitial tape state. It's been said that any computable problem can be expressed on a turing machine.


The script files have a very basic syntax. Each line of the script represents a state that the turing machine can be in (yes, you will need a text editor with numbered lines). On each line (in each state) the machine may have any number of conditions. Conditions are enclosed in parentheses and are laid out in this order...

(in, out, move, jumpToLine)

The turing machine will read the character at the character pointer (which starts at the first character in the input), if that character is equal to the "in" value, then it gets changed to the "out" value, the character pointer gets adjusted by the value of "move" (-1 moves to the left of the current character, 1 moves to the right), and then the machine jumps to the line designated by "jumpToLine".

If a line has more than one condition, it starts by checking the condition on the far left, if that one is false, then it moves to the next, and so on. The machine will end when a condition's "jumpToLine" value is 0 (the terminate command) or when there is no true condition for that line. To repeat a line, just make its "jumpToLine" equal to its own line. To leave a character unchanged, change it to itself. The input tape is infinite, you may go as far left as you'ld like, and as far right as you'ld like.


Hello world (no input):


Binary Incrementer (input in the form of a binary number):

(48,48, 1,1) (49,49,1,1) (0, 0,-1,2)
(49,48,-1,2) (48,49,0,0) (0,49, 0,0)

Adding Machine (input in the form of INTEGER+INTEGER):


External resources