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

slightly less confusing syntax for :bf
(→‎Usage: load from file)
(slightly less confusing syntax for :bf)
Line 3:
==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:
;
 
: :bf" ( name " bfcode" -- )
:
[char] " parse \ get string delimiter
compile-bf-string ;
 
Anonymous user