Execute Brain****/BASIC/QuickBasic: Difference between revisions
Content deleted Content added
m Speed up processing a bit by putting more common characters at the front of the instruction chars string |
m Typos, some better description, I'm doing what I did for the Java version...stop me |
||
Line 1: | Line 1: | ||
{{implementation|Brainf***}}{{collection|RCBF}}[[Category:BASIC]]This implementation is very limited by BASIC. The memory space cannot be resized (not Turing complete). It is initially set to 20000, but can be changed before running the program. Input will not accept return characters at all. A buffer is programmed in for input, as well. |
{{implementation|Brainf***}}{{collection|RCBF}}[[Category:BASIC]]This implementation is very limited by BASIC. The memory space cannot be resized (not Turing complete). It is initially set to 20000, but can be changed before running the program. Input will not accept return characters at all. A buffer is programmed in for input, as well. |
||
The program first asks for a filename for BF source code. If no filename is given (return hit without typing anything), the program accepts source from std in. The program then cleans up the code similarly to |
The program first asks for a filename for BF source code. If no filename is given (return hit without typing anything), the program accepts source from std in. To end your std input, enter a blank line (completely blank, no whitespace). Source files don't need a blank line since BASIC has EOF support. The program then cleans up the code similarly to [[RCBF (Java)]] and reports an uneven bracket error if it exists. Input works with a programmed buffer. It takes in an entire line if the buffer is empty, or it takes the first character from the buffer if it's not (just like the way you'd expect a buffer to work). Looping works the same as in RCBF (Java), as well. |
||
{{works with|QuickBasic|4.5}} |
{{works with|QuickBasic|4.5}} |
||
Line 93: | Line 93: | ||
CASE "]" |
CASE "]" |
||
IF memory(ptr) <> 0 THEN |
IF memory(ptr) <> 0 THEN |
||
bktCnt = -1'count the |
bktCnt = -1'count the bracket we're on |
||
i = i - 1'move the code pointer back a char |
i = i - 1'move the code pointer back a char |
||
WHILE bktCnt <> 0 |
WHILE bktCnt <> 0 |