smile

From Esolang
Jump to navigation Jump to search

smile is inspired by brainfuck. It decomposes [] into two parts q p and < >.It merges. And, into +.

Instruction set one

Line : 00: instructions ,01:Pointer 1,02:Pointer 2......99: display screen.
+   _l1_(Line) _l2_(Line) The byte pointed to by pointer L1 plus the byte pointed to by pointer L2.
+   _l1_(Line) _x_(number) The byte pointed to by pointer L1 plus x.
-   _l1_(Line) _l2_(Line) The byte pointed by pointer  L1  minus the byte pointed by pointer  L2 .
</> _l_(Line) _x_(number) Move x bits to the left or right in l.
q:⌒⌒If the cell at the pointer is not 0, it executes normally.
  ╰╯If the cell at the pointer is 0,the next instruction will be skipped.
p:⌒⌒If the cell at the pointer is 0,, it executes normally.
  ╰╯If the cell at the pointer is not 0,the next instruction will be skipped.
Special:
. = + 99 _l1_(Line) Output the byte pointed by pointer L1 to the display screen.
, = + _l1_(Line) 99 Input from the display to the byte pointed by pointer L1.

--2021.07.12

Instruction set two

It uses haver structure to store program and data separately. So there are two pointers to the memory address. The read-write head of a Turing machine is a pointer. Read write head of Turing machine:0 , Program pointer:1 , Data pointer:2 , number:x

+/-/</> 0/1/2 x/0/1/2: 0/1/2 = 0/1/2 +/-/</> x/0/1/2
0       1     2        1     = 1     0       2
d/q     0/1/2 0/1/2  : if 0/1/2 d:!=/q:== 0 0/1/2 > 2
0       1     2           1     0           2
+/- 0x Add or subtract x from the byte pointed by the read-write head of Turing machine.
+/- 00 The Turing machine read-write header to the byte plus or minus the Turing machine read-write header to the byte.
+/- 01 Add or subtract the bytes pointed to by the program pointer from the bytes pointed to by the Turing machine read-write header.
+/- 02 Add or subtract the byte pointed to by the data pointer from the byte pointed to by the Turing machine read-write header.
+/- 1x Add or subtract x from the byte pointed to by the program pointer.
+/- 10 Program pointer to the byte plus or minus the Turing machine read-write header to the byte.
+/- 11 Add or subtract the bytes pointed to by the program pointer from the bytes pointed to by the program pointer.
+/- 12 Program pointer to the byte plus or minus the data pointer to the byte.
+/- 2x Add or subtract x from the byte pointed to by the data pointer.
+/- 20 Data pointer to the byte plus or minus the Turing machine read-write header to the byte.
+/- 21 Data pointer to the byte plus or minus the program pointer to the byte.
+/- 22 The byte that the data pointer points to plus or minus the byte that the data pointer points to.
+:Add,-:subtract,<:towards the left,>:towards the right,d=P,q=Q(See above)

--2021.07.21