Baba Is Turing machine

From Esolang
Jump to navigation Jump to search

BITm (Baba Is Turing machine) is inspired by languages like Babalang and https://www.youtube.com/watch?v=hsXpLx4soQY. Baba Is Turing machine was made by User:A() with the premise of being Baba is you but only with the turing machine elements.

Commands

Commands
Cmd Description
A-Z States
FLAG Halt state
LEFT RIGHT DOWN Directions
AND X and Y
IS (I don't need to explan)
ON If X is on Y then ...
0-9 values

Syntax

At the beginning of the program there are invisable rules (non-editable rules) and you can't see them there so their just there by default. At the end of the program there is a tape like this:

TAPE IS 000100010010000
START AT CELL N (COUNTS FROM RIGHT TO LEFT)

Because of how commands work, rules look like this

[State] ON [Value] IS [Direction] AND [New state]
[State] ON [Value] IS [Direction]
[State] ON [Value] IS [New state]
[Value] ON [State] IS [New value]

Programs

Truth machine

0 ON A IS 0
1 ON A IS 1
0 ON B IS 0
1 ON B IS 1
0 ON C IS 0
1 ON C IS 1
// Rules for states
A ON 0 IS LEFT AND B
B ON 0 IS DOWN AND FLAGT
A ON 1 IS RIGHT AND C
C ON 0 IS LEFT AND A
TAPE IS 010
START AT CELL 2

Wolfram's 2-state 3-symbol Turing machine

0 ON A IS 1
1 ON A IS 2
2 ON A IS 1
0 ON B IS 2
1 ON B IS 2
2 ON B IS 0
// Rules for states
A ON 0 IS RIGHT AND B
A ON 1 IS LEFT AND A
A ON 2 IS LEFT AND A
B ON 0 IS LEFT AND A 
B ON 1 IS RIGHT AND B
B ON 2 IS RIGHT AND B
TAPE IS 000000000000000000000
START AT CELL 11

Counter

0 ON A IS 1
1 ON A IS 2
2 ON A IS 3
3 ON A IS 4
4 ON A IS 5
5 ON A IS 6
6 ON A IS 7
7 ON A IS 8
8 ON A IS 9
9 ON A IS 0
0 ON B IS 1
1 ON B IS 2
2 ON B IS 3
3 ON B IS 4
4 ON B IS 5
5 ON B IS 6
6 ON B IS 7
7 ON B IS 8
8 ON B IS 9
9 ON B IS 0 
// Rules for states
A ON 9 IS LEFT AND B
B ON 1 IS RIGHT AND A
B ON 2 IS RIGHT AND A
B ON 3 IS RIGHT AND A
B ON 4 IS RIGHT AND A
B ON 5 IS RIGHT AND A
B ON 6 IS RIGHT AND A
B ON 7 IS RIGHT AND A
B ON 8 IS RIGHT AND A
B ON 9 IS RIGHT AND A

Only counts to 99

This is still a work in progress. It may be changed in the future.