Skip to content

Instantly share code, notes, and snippets.

@Abhi-ctrl-cmd
Created March 7, 2021 22:08
Show Gist options
  • Save Abhi-ctrl-cmd/9cbe19b21966e667b2907db46ad6ac22 to your computer and use it in GitHub Desktop.
Save Abhi-ctrl-cmd/9cbe19b21966e667b2907db46ad6ac22 to your computer and use it in GitHub Desktop.
In each iteration, the program checks if the current instruction is +/,/-/./</>/[/] (in that order). If it obtains a match, it executes the instruction, but does not restart the loop; eg if there is a "++" sequence, it executes the first one but compares the second one to a , then - etc, and cycles back to plus.
The tape is configured as follows:
1 = instruction counter (no of instructions executed in current iteration)*
2 & 3 = program counter PC
4 & 5 = tape counter TC
6 = bracket counter (for nested brackets) BC
7 = buffer (always 0 except for copying purposes)
8 = beginning of input program T1 (always 255 except for copying purposes)
9 etc = input program; each instruction takes 4 cells (x; x; 255; 255)
after program = buffer; temp cell (T2 = 255); simulated tape; each simulated tape cell takes 3 cells (y; 255; 255)
* This is the exit control. If this value is 0 at the end of an iteration, that means a non-bf symbol has been encountered, and the execution stops. Note that this means that all codes must be terminated by a non-bf symbol to prevent undefined behaviour.
The simulated tape cells' values are never 0. They are initialised as 1 (or 1 + input, if input is taken). They are decremented before outputting (in case a fullstop is encountered) and then incremented again. This is in order to find the beginning of the simulated tape easily using the "[<]" idiom.
SETDATA
In this section, the code initialises the data cells 1 to 8, takes the code as input, and initialises two cells of simulated tape. Every time an instruction is taken, 48 is subtracted from it to check if its value is 0; if it is, then input stops. Hence, all codes have to be terminated by a non-bf symbol followed by a 0.
CHECKINST
Here the code checks the instruction and executes it.
RESET
This part of resets the IC and moves to the PC.
ISPLUS
This part of the code checks if the instruction is a plus.
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 43 from x to check if it's a plus. If it is, it ends at (x-43:x:0:'0'); else it ends at (0:'44':0:255).
This bracket is an if.
DOPLUS
The code enters here if x = 43, but it has been incremente. The first two lines make it ('255':43:0:255). The next line updates PC and IC.
The next two lines find the simulated tape cell pointed at by TC in the same way as the instruction was found. It ends at ('y':255:255).
The next line is THE SHIT.
The last two lines restore the TC and go back to the instruction. It ends as (0:43:0:'0') and exits the if.
ISNOTPLUS
The first two lines reset both (x-43:x:0:'0') and (0:43:0:'0') to (x:x:'255':255).
The next three lines restore PC and go to PC1. If the current instruction is a plus it has been executed.
ISCOMMA
This part of the code checks if the instruction is a comma.
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 44 from x to check if it's a comma. If it is, it ends at (x-44:x:0:'0'); else it ends at (0:'45':0:255).
This bracket is an if.
DOCOMMA
The code enters here if x = 44, but it has been incremente. The first two lines make it ('255':4:0:255). The next line updates PC and IC.
The next two lines find the simulated tape cell pointed at by TC in the same way as the instruction was found. It ends at ('y':255:255).
The next line is THE SHIT.
The last two lines restore the TC and go back to the instruction. It ends as (0:44:0:'0') and exits the if.
ISNOTCOMMA
The first two lines reset both (x-44:x:0:'0') and (0:44:0:'0') to (x:x:'255':255).
The next three lines restore PC and go to PC1. If the current instruction is a comma it has been executed.
ISMINUS
This part of the code checks if the instruction is a minus.
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 45 from x to check if it's a minus. If it is, it ends at (x-45:x:0:'0'); else it ends at (0:'46':0:255).
This bracket is an if.
DOMINUS
The code enters here if x = 45, but it has been incremente. The first two lines make it ('255':45:0:255). The next line updates PC and IC.
The next two lines find the simulated tape cell pointed at by TC in the same way as the instruction was found. It ends at ('y':255:255).
The next line is THE SHIT.
The last two lines restore the TC and go back to the instruction. It ends as (0:45:0:'0') and exits the if.
ISNOTMINUS
The first two lines reset both (x-45:x:0:'0') and (0:46:0:'0') to (x:x:'255':255).
The next three lines restore PC and go to PC1. If the current instruction is a minus it has been executed.
ISPERIOD
This part of the code checks if the instruction is a .
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 46 from x to check if it's a period. If it is, it ends at (x-46:x:0:'0'); else it ends at (0:'47':0:255).
This bracket is an if.
DOPERIOD
The code enters here if x = 46, but it has been incremente. The first two lines make it ('255':46:0:255). Next line updates PC and IC.
The next two lines find the simulated tape cell pointed at by TC in the same way as the instruction was found. It ends at ('y':255:255).
The next line is THE SHIT.
The last two lines restore the TC and go back to the instruction. It ends as (0:46:0:'0') and exits the if.
ISNOTPERIOD
The first two lines reset both (x-46:x:0:'0') and (0:46:0:'0') to (x:x:'255':255).
The next three lines restore PC and go to PC1. If the current instruction is a period it has been executed.
ISLANGLE
This part of the code checks if the instruction is a <.
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 60 from x to check if it's a left angle bracket. If it is, it ends at (x-60:x:0:'0'); else it ends at (0:'61':0:255).
This bracket is an if.
DOLANGLE
The code enters here if x = 60, but it has been incremente. The first two lines make it ('255':60:0:255). The next line updates PC and IC.
The next line is THE SHIT.
The last line goes back to the instruction. It ends as (0:60:0:'0') and exits the if.
ISNOTLANGLE
The first two lines reset both (x-60:x:0:'0') and (0:60:0:'0') to (x:x:'255':255).
The next three lines restore PC and go to PC1. If the current instruction is a left angle bracket it has been executed.
ISRANGLE
This part of the code checks if the instruction is a >.
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 62 from x to check if it's a right angle bracket. If it is, it ends at (x-62:x:0:'0'); else it ends at (0:'63':0:255).
This bracket is an if.
DORANGLE
The code enters here if x = 62, but it has been incremente. The first two lines make it ('255':62:0:255). The next line updates PC and IC.
The next line is THE SHIT.
The last line goes back to the instruction. It ends as (0:62:0:'0') and exits the if.
ISNOTRANGLE
The first two lines reset both (x-62:x:0:'0') and (0:62:0:'0') to (x:x:'255':255).
The next three lines restore PC and go to PC1. If the current instruction is a right angle bracket it has been executed.
ISLSQ
This part of the code checks if the instruction is a [.
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 91 from x to check if it's a left square bracket. If it is, it ends at (x-91:x:0:'0'); else it ends at (0:'92':0:255).
This bracket is an if.
DOLSQ
The code enters here if x = 91, but it has been incremente. The first two lines make it ('255':91:0:255). The next line updates PC and IC.
The next three lines find the simulated tape cell pointed to by the TC and decrement it by 1. This ends at (0:'1':255) or (y-1:0:'0').
This bracket is also an if.
IFZERO
This part of the code searches for a corresponding closing bracket. It identifies each instruction before proceeding. The BC is used to account for nested loops.
The first three lines set it to ('0':0:255), increment BC and restore PC.
SEARCHR
The first line goes to PC.
ISLSQ
The first two lines find the instruction pointed to by PC in the same way, which is the next one after [ because PC was incremented in DOLSQ.
The next two lines check if this is [ by subtracting 91. It ends at (0:'92':0:255) or (z-91:z:0:'0').
This bracket is also an if.
IFLSQ
If it is [, this part of the code increments BC and PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:91:0:'0').
IFNOTLSQ
The first two lines reset both (z-91:z:0:'0') and (0:91:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISRANGLE
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is > by subtracting 62. It ends at (0:'63':0:255) or (z-62:z:0:'0').
This bracket is also an if.
IFRANGLE
If it is >, this part of the code increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:62:0:'0').
IFNOTRANGLE
The first two lines reset both (z-62:z:0:'0') and (0:62:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISLANGLE
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is < by subtracting 60. It ends at (0:'61':0:255) or (z-60:z:0:'0').
This bracket is also an if.
IFLANGLE
If it is <, this part of the code increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:60:0:'0').
IFNOTLANGLE
The first two lines reset both (z-60:z:0:'0') and (0:60:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISPERIOD
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is . by subtracting 46. It ends at (0:'47':0:255) or (z-46:z:0:'0').
This bracket is also an if.
IFPERIOD
If it is ., this part of the code increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:46:0:'0').
IFNOTPERIOD
The first two lines reset both (z-46:z:0:'0') and (0:46:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISMINUS
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is - by subtracting 45. It ends at (0:'46':0:255) or (z-45:z:0:'0').
This bracket is also an if.
IFMINUS
If it is -, this part of the code increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:45:0:'0').
IFNOTMINUS
The first two lines reset both (z-45:z:0:'0') and (0:45:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISCOMMA
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is , by subtracting 44. It ends at (0:'45':0:255) or (z-44:z:0:'0').
This bracket is also an if.
IFCOMMA
If it is , this part of the code increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:44:0:'0').
IFNOTMINUS
The first two lines reset both (z-44:z:0:'0') and (0:44:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISPLUS
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is + by subtracting 43. It ends at (0:'44':0:255) or (z-43:z:0:'0').
This bracket is also an if.
IFPLUS
If it is +, this part of the code increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:43:0:'0').
IFNOTPLUS
The first two lines reset both (z-43:z:0:'0') and (0:43:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISRSQ
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is ] by subtracting 93. It ends at (0:'94':0:255) or (z-93:z:0:'0').
This bracket is also an if.
IFRSQ
If it is ], this part of the code decrements BC and increments PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:93:0:'0').
IFNOTRSQ
The first two lines reset both (z-93:z:0:'0') and (0:93:0:'0') to (z:z:'255':255).
The next two lines restore PC.
The last line goes back to BC to continue the loop in case a match has not been found.
FOUNDR
Here, PC points to the instruction immediately after the closing bracket. These two lines restore the TC and find the simulated tape cell again. This ends at (0;0;'0') and it exits the if.
IFNOTZERO
This part of the code sets both (y-1:0:'0') and (0:0:'0') to (y:0:'0'). It then returns to [ in the. This ends at (0:91:0:'0') and exits the if. The program counter now points at the instruction after [ if the simulated tape cell is nonzero and at the instruction after the corresponding ] otherwise.
ISNOTLSQ
The first two lines reset both (x-91:x:0:'0') and (0:91:0:'0') to (x:x:'255':255).
The next three lines restore PC and TC and go to PC1. If the current instruction is a right angle bracket it has been executed.
ISRSQ
This part of the code checks if the instruction is a ].
The first two lines find the instruction by copying PC four places to the right each time (it gets decremented because it is added to 255). It ends at the config (x:x:'0':255).
The next two lines subtract 93 from x to check if it's a right square bracket. If it is, it ends at (x-93:x:0:'0'); else it ends at (0:'94':0:255).
This bracket is an if.
DORSQ
The code enters here if x = 93, but it has been incremente. The first two lines make it ('255':93:0:255). The next line updates IC (NOT PC - this is done in IFNOTZERO).
The next two cells find the simulated tape cell pointed to by the TC and decrement it by 1. This ends at (y-1:0:255) or ('0':0:255).
This bracket is also an if.
IFNOTZERO
This part of the code searches for a corresponding opening bracket. It identifies each instruction before proceeding. The BC is used to account for nested loops.
The first three lines set it to ('y':0:255) and decrement BC and PC.
SEARCHL
The first line goes to PC.
ISRSQ
The first two lines find the instruction pointed to by PC in the same way, which is the previous one before ] because PC was decremented in IFNOTZERO.
The next two lines check if this is ] by subtracting 93. It ends at (0:'94':0:255) or (z-93:z:0:'0').
This bracket is also an if.
IFRSQ
If it is ], this part of the code decrements BC and PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:93:0:'0').
IFNOTRSQ
The first two lines reset both (z-93:z:0:'0') and (0:93:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISRANGLE
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is > by subtracting 62. It ends at (0:'63':0:255) or (z-62:z:0:'0').
This bracket is also an if.
IFRANGLE
If it is >, this part of the code decrements PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:62:0:'0').
IFNOTRANGLE
The first two lines reset both (z-62:z:0:'0') and (0:62:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISLANGLE
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is < by subtracting 60. It ends at (0:'61':0:255) or (z-60:z:0:'0').
This bracket is also an if.
IFLANGLE
If it is <, this part of the code decrements PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:60:0:'0').
IFNOTRANGLE
The first two lines reset both (z-60:z:0:'0') and (0:60:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISPERIOD
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is . by subtracting 46. It ends at (0:'47':0:255) or (z-46:z:0:'0').
This bracket is also an if.
IFPERIOD
If it is ., this part of the code decrements PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:46:0:'0').
IFNOTPERIOD
The first two lines reset both (z-46:z:0:'0') and (0:46:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISMINUS
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is - by subtracting 45. It ends at (0:'46':0:255) or (z-45:z:0:'0').
This bracket is also an if.
IFMINUS
If it is -, this part of the code decrements PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:45:0:'0').
IFNOTMINUS
The first two lines reset both (z-45:z:0:'0') and (0:45:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISCOMMA
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is , by subtracting 44. It ends at (0:'45':0:255) or (z-44:z:0:'0').
This bracket is also an if.
IFCOMMA
If it is , this part of the code decrements PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:44:0:'0').
IFNOTMINUS
The first two lines reset both (z-44:z:0:'0') and (0:44:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISPLUS
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is + by subtracting 43. It ends at (0:'44':0:255) or (z-43:z:0:'0').
This bracket is also an if.
IFPLUS
If it is +, this part of the code decrements PC (i.e., continues the search) and comes back to the 'z' instruction. It ends as (0:43:0:'0').
IFNOTPLUS
The first two lines reset both (z-43:z:0:'0') and (0:43:0:'0') to (z:z:'255':255).
The next two lines restore PC.
ISLSQ
The first two lines find the instruction pointed to by PC in the same way.
The next two lines check if this is [ by subtracting 91. It ends at (0:'92':0:255) or (z-93:z:0:'0').
This bracket is also an if.
IFLSQ
If it is [, this part of the code increments BC and comes back to the 'z' instruction. It ends as (0:91:0:'0').
IFNOTLSQ
The first two lines reset both (z-91:z:0:'0') and (0:91:0:'0') to (z:z:'255':255).
The next two lines restore PC.
The last line goes back to BC to continue the loop in case a match has not been found.
FOUNDL
Here, PC points to the the opening bracket. These two lines restore the TC and find the simulated tape cell again. This ends at ('0';y-1;0) and it exits the if.
IFZERO
This part of the code sets both ('y-1':0:0) and ('0':y-1:0) to ('y':255:255). It then returns to ] in the program. This ends at (0:93:0:'0') and exits the if. The program counter now points at the corresponding [ if the simulated tape cell is nonzero and at the instruction after ] otherwise.
ISNOTRSQ
The first two lines reset both (x-93:x:0:'0') and (0:93:0:'0') to (x:x:'255':255).
The next four lines restore PC and TC and go to PC1. If the current instruction is a right square bracket it has been executed.
The last line goes back to the IC to check if any instruction has been executed in the current cycle. If it has not, it terminates; else it continues.
Flow of Program:
CHECKINST
RESET
ISPLUS
DOPLUS
ISNOTPLUS
ISCOMMA
DOCOMMA
ISNOTCOMMA
ISMINUS
DOMINUS
ISNOTMINUS
ISPERIOD
DOPERIOD
ISNOTPERIOD
ISLANGLE
DOLANGLE
ISNOTLANGLE
ISRANGLE
DORANGLE
ISNOTRANGLE
ISLSQ
DOLSQ
IFZERO
SEARCHR
ISLSQ
IFLSQ
IFNOTLSQ
ISRANGLE
IFRANGLE
IFNOTRANGLE
ISLANGLE
IFLANGLE
IFNOTLANGLE
ISPERIOD
IFPERIOD
IFNOTPERIOD
ISMINUS
IFMINUS
IFNOTMINUS
ISCOMMA
IFCOMMA
IFNOTCOMMA
ISPLUS
IFPLUS
IFNOTPLUS
ISRSQ
IFRSQ
IFNOTRSQ
FOUNDR
IFNOTZERO
ISNOTLSQ
ISRSQ
DORSQ
IFNOTZERO
SEARCHL
ISRSQ
IFRSQ
IFNOTRSQ
ISRANGLE
IFRANGLE
IFNOTRANGLE
ISLANGLE
IFLANGLE
IFNOTLANGLE
ISPERIOD
IFPERIOD
IFNOTPERIOD
ISMINUS
IFMINUS
IFNOTMINUS
ISCOMMA
IFCOMMA
IFNOTCOMMA
ISPLUS
IFPLUS
IFNOTPLUS
ISLSQ
IFLSQ
IFNOTLSQ
FOUNDL
IFZERO
ISNOTRSQ
SETDATA
+>+>+>+>+>>>->
,>+++++[-<---------->]<++ [>+++++[-<++++++++++>]<-- [->+>+<<]>>[-<<+>>] ->-> , >+++++[-<---------->]<++]>->
+>->->+>->-
[<]<[<]<<<<<<
CHECKINST
[
RESET
[-]
>
_______________________________________________________
ISPLUS
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<---
[>]>+
[
DOPLUS
-
<-
[<]<<<<+<<+>>>
[->>>>[>]>[>]>+<<[<]<[<]<<<]>>>>[>]>[>]>+
[>>>+<<< [->>>+<<<]- >>>-]-<<
+
[<]<[<]<[<]<< [-<+>>>+<<]>>[-<<+>>]
>[>]<<+>>>+
]
ISNOTPLUS
-<<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>>>>+<<<<]>>>>[-<<<<+>>>>]
<<<<<
_______________________________________________________
ISCOMMA
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<----
[>]>+
[
DOCOMMA
-
<-
[<]<<<<+<<+>>>
[->>>>[>]>[>]>+<<[<]<[<]<<<]>>>>[>]>[>]>+
[>>>+<<< [->>>+<<<]- >>>-]-<<
,+
[<]<[<]<[<]<< [-<+>>>+<<]>>[-<<+>>]
>[>]<<+>>>+
]
ISNOTCOMMA
-<<<+[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>>>>+<<<<]>>>>[-<<<<+>>>>]
<<<<<
_______________________________________________________
ISMINUS
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<-----
[>]>+
[
DOMINUS
-
<-
[<]<<<<+<<+>>>
[->>>>[>]>[>]>+<<[<]<[<]<<<]>>>>[>]>[>]>+
[>>>+<<< [->>>+<<<]- >>>-]-<<
-
[<]<[<]<[<]<< [-<+>>>+<<]>>[-<<+>>]
>[>]<<+>>>+
]
ISNOTMINUS
-<<<++[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>>>>+<<<<]>>>>[-<<<<+>>>>]
<<<<<
_______________________________________________________
ISPERIOD
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<------
[>]>+
[
DOPERIOD
-
<-
[<]<<<<+<<+>>>
[->>>>[>]>[>]>+<<[<]<[<]<<<]>>>>[>]>[>]>+
[>>>+<<< [->>>+<<<]- >>>-]-<<
-.+
[<]<[<]<[<]<< [-<+>>>+<<]>>[-<<+>>]
>[>]<<+>>>+
]
ISNOTPERIOD
-<<<++[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>>>>+<<<<]>>>>[-<<<<+>>>>]
<<<<<
_______________________________________________________
ISLANGLE
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++++[-<<---------->>]<<
[>]>+
[
DOLANGLE
-
<-
[<]<<<<+<<+>>>
->-
>>>[>]<<+>>>+
]
ISNOTLANGLE
-<++++[-<<+++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>>>>+<<<<]>>>>[-<<<<+>>>>]
<<<<<
_______________________________________________________
ISRANGLE
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++++[-<<---------->>]<<--
[>]>+
[
DORANGLE
-
<-
[<]<<<<+<<+>>>
+>+
>>>[>]<<+>>>+
]
ISNOTRANGLE
-<++++[-<<+++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>>>>+<<<<]>>>>[-<<<<+>>>>]
<<<<<
_______________________________________________________
ISLSQ
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
+++++++++[-<<---------->>]<<-
[>]>+
[
DOLSQ
-
<-
[<]<<<<+<<+>>>
[->>>>[>]>[>]>+<<[<]<[<]<<<]>>>>[>]>[>]>+
[>>>+<<< [->>>+<<<]- >>>-]-<+<-
[>]>+
[
IFZERO
-<
<[<]<[<]<[<]<+<<<
[-<+>>+<]>[-<+>]>>
[
SEARCHR
<<<<
________________________________________
ISLSQ
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
+++++++++[-<<---------->>]<<-
[>]>+
[
IFLSQ
-<-
[<]<[<]<+<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTLSQ
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISRANGLE
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++++[-<<---------->>]<<--
[>]>+
[
IFRANGLE
-<-
[<]<[<]<<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTRANGLE
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISLANGLE
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++++[-<<---------->>]<<
[>]>+
[
IFLANGLE
-<-
[<]<[<]<<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTLANGLE
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISPERIOD
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<------
[>]>+
[
IFPERIOD
-<-
[<]<[<]<<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTPERIOD
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISMINUS
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<-----
[>]>+
[
IFMINUS
-<-
[<]<[<]<<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTMINUS
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISCOMMA
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<----
[>]>+
[
IFCOMMA
-<-
[<]<[<]<<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTCOMMA
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISPLUS
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<---
[>]>+
[
IFPLUS
-<-
[<]<[<]<<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTPLUS
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISRSQ
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
+++++++++[-<<---------->>]<<---
[>]>+
[
IFRSQ
-<-
[<]<[<]<-<<<+
>>>>>[>]>[>]<<+>>>+
]
IFNOTRSQ
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
>>>>
]
FOUNDR
<[-<+>>>+<<]>>[-<<+>>]
>[>]>[>]>[>]>>+
]
IFNOTZERO
-<-<+
[<]<[<]<<+>>>+
]
ISNOTLSQ
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<[-]<<[-]>
[-<+>>+<]>[-<+>]
>[-<+>>>+<<]>>[-<<+>>]
<<<<<
_______________________________________________________
ISRSQ
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
+++++++++[-<<---------->>]<<---
[>]>+
[
DORSQ
-
<-
[<]<<<<<<+>>>
[->>>>[>]>[>]>+<<[<]<[<]<<<]>>>>[>]>[>]>+
[>>>+<<< [->>>+<<<]- >>>-]-<+<-
[
IFNOTZERO
+
[<]<[<]<[<]<-<<<-
[-<+>>+<]>[-<+>]>>
[
SEARCHL
<<<<
________________________________________
ISRSQ
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
+++++++++[-<<---------->>]<<---
[>]>+
[
IFRSQ
-<-
[<]<-<<<-
>>>>>[>]<<+>>>+
]
IFNOTRSQ
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISRANGLE
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++++[-<<---------->>]<<--
[>]>+
[
IFRANGLE
-<-
[<]<<<<-
>>>>>[>]<<+>>>+
]
IFNOTRANGLE
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISLANGLE
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++++[-<<---------->>]<<
[>]>+
[
IFLANGLE
-<-
[<]<<<<-
>>>>>[>]<<+>>>+
]
IFNOTLANGLE
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISPERIOD
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<------
[>]>+
[
IFPERIOD
-<-
[<]<<<<-
>>>>>[>]<<+>>>+
]
IFNOTPERIOD
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISMINUS
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<-----
[>]>+
[
IFMINUS
-<-
[<]<<<<-
>>>>>[>]<<+>>>+
]
IFNOTMINUS
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISCOMMA
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<----
[>]>+
[
IFCOMMA
-<-
[<]<<<<-
>>>>>[>]<<+>>>+
]
IFNOTCOMMA
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISPLUS
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
++++[-<<---------->>]<<---
[>]>+
[
IFPLUS
-<-
[<]<<<<-
>>>>>[>]<<+>>>+
]
IFNOTPLUS
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
ISLSQ
[->>>>>>+<<<<<<]>>>>>>+
[>>>>+<<<< [->>>>+<<<<]->>>>-]-<+
+++++++++[-<<---------->>]<<-
[>]>+
[
IFLSQ
-<-
[<]<+<<<
>>>>>[>]<<+>>>+
]
IFNOTLSQ
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<<
[-<+>>+<]>[-<+>]<<
________________________________________
>>>>
]
FOUNDL
<<<
>>[-<+>>>+<<]>>[-<<+>>]
>[>]>[>]>[>]<-
[->+<]
]
IFNOTZERO
>[-<+>]
-<+
[<]<[<]<<+>>>+
<<<<[<]<<<<+<+>>>>>>[>]>>>
]
ISNOTLSQ
-<+++++[-<<++++++++++>>]<<[-]>
[-<+>>+<]>[-<+>]-
[<]<<<[-]<<[-]>
[-<+>>+<]>[-<+>]
>[-<+>>>+<<]>>[-<<+>>]
<<<<<
_______________________________________________________
<
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment