Execute Brain****/Forth: Difference between revisions

m
(→‎Usage: load from file)
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{implementation|Brainf***}}{{collection|RCBF}}A Brainf*** compiler written by [[User:IanOsgood|Ian Osgood]] in [[Forth]].[[Category:Forth]]
A Brainf*** compiler written by [[User:IanOsgood|Ian Osgood]] in [[Forth]].
 
==Usage==
 
Load the code your preferred Forth environment. The code will define the words ''':bf"''' and ''':bf-file''',
===Compiling Brainf*** code===
Let's say you have this sequence that prints a capital A:
++++++[>+++++++++++<-]>-.
You can compile it by using the ''':bf"''' word:
:bf" printA " ++++++[>+++++++++++<-]>-."
Your Brainf*** code is now compiled in your Forth environment as the word '''printA'''. If you want to use a different name, replace printA with your preferred name.
 
Line 53 ⟶ 54:
;
 
: :bf" ( name " bfcode" -- )
:
[char] " parse \ get string delimiter
compile-bf-string ;
 
Anonymous user