Execute Brain****/JavaScript: Difference between revisions
Content added Content deleted
m (moved RCBF/JavaScript to Execute Brain****/JavaScript) |
m (Fixed syntax highlighting.) |
||
Line 2: | Line 2: | ||
Presented here is the core of a Brainf*** interpreter/debugger written in [[JavaScript]] that is designed to run within a web page. The full source can be found at http://www.quirkster.com/iano/js/bf.html by viewing the page source. |
Presented here is the core of a Brainf*** interpreter/debugger written in [[JavaScript]] that is designed to run within a web page. The full source can be found at http://www.quirkster.com/iano/js/bf.html by viewing the page source. |
||
< |
<syntaxhighlight lang="javascript">var code; // formatted code |
||
var ip = 0; // current instruction within code |
var ip = 0; // current instruction within code |
||
var nest = 0; // current bracket nesting (for Out button) |
var nest = 0; // current bracket nesting (for Out button) |
||
Line 135: | Line 135: | ||
body(); |
body(); |
||
dump(); |
dump(); |
||
}</ |
}</syntaxhighlight> |