brainsooth concept

mail@pastecode.io avatarunknown
python
a month ago
2.5 kB
4
Indexable
Never
code_example = """
                    ; brainsooth is a alternative to brainfuck with asm like syntax. giving you more peace of mind while still being able to use pure turing (with edition of VOC and EOL)
                    ; this is a comment
                    ; comments are ignored
                    ; all operators must be in uppercase
                    ; different operators must be sepreated by a comma, even in line breaks
                        ; the only exceptions are loop operators, and operators that work as a parameter for another operator
                        
                    ; convention says that the comments should be on the same line as the code, like cpp
                    ; convention also says that the code should be indented with tabs. you do not need to indent, but you must use tabs if you do.
                    ; convention also no line should go above 2 operators
                    ; convention also says the line starting/ending a loop should only contain the loop operators
                    
INC 5,               ; increments the current cell by 5
                     ; INC is the operator, 5 is the value for its parameter which must be an integer
UP, INC 2,           ; focuses on the cell above and increments it by 2
[                    ; loops the code until a cell in the loop is 0
    UP, INC 2,
    UP, INC 2,
    UP, INC 2,
    JMP 0, DEC 1,    ; goes to cell 0 and decrements it by 1
]
"""

code_example_output = "+++++>++[>++>++>++>++<<<<-]"

code_example_2 = """
INC 1,
[
    UP, INC VOC 0,            ; inc the current cell by the value of cell 0
    DWN, DEC 1,               ; like fwd, it focuses on the cell below (and decrements it by 1 ofc)
]
UP, INC 1
"""

code_example_output_2 = "+[>+<-]>+"

code_example_3 = """
INC 1,
UP, INC 1,
UP, INC 1,
FWD 4, INC 1,
OUT             ; prints the ascii value of the current cell by default so cur is not needed, but can be changed to print the value of another cell by using out <*cell>
"""

code_example_output_3 = "+>+>+>>>>+."

code_example_4 = """
UP, INC INP CUR, ; gets input and stores it in the current cell by default. simular to out, cur is not needed and can be changed to store the input in another cell
OUT 
"""

code_example_output_4 = ",."

code_example_5 = """
UP, INC 1,
EOL             ; ends the program, what ever comes after this is ignored
UP, INC 1
"""