Execute Brain****/BASIC/QuickBasic: Difference between revisions
Execute Brain****/BASIC/QuickBasic (view source)
Revision as of 11:02, 1 September 2022
, 1 year agoFixed syntax highlighting.
(cat) |
m (Fixed syntax highlighting.) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1:
{{implementation|Brainf***}}{{collection|RCBF}}
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
{{works with|QuickBasic|4.5}}
<syntaxhighlight lang="qbasic">CLS
memsize = 20000
instChars$ = "
ptr = 0 'memory pointer
Line 30 ⟶ 31:
in = 0
'check to see if this is a valid instruction character
code$ = code$ + char$
'count brackets
Line 93 ⟶ 86:
CASE "]"
IF memory(ptr) <> 0 THEN
bktCnt = -1'count the
i = i - 1'move the code pointer back a char
WHILE bktCnt <> 0
Line 104 ⟶ 97:
END IF
END SELECT
NEXT i</
|