Execute Brain****: Difference between revisions
→{{header|Limbo}}: Add example output, and a change that makes awib-0.3 run.
(Add a Limbo implementation.) |
(→{{header|Limbo}}: Add example output, and a change that makes awib-0.3 run.) |
||
Line 960:
p := 0;
buf := array[1] of byte;
stopreading := 0;
for(;;) {
case code[pc] {
Line 971 ⟶ 972:
p = (p + 1) % len arena;
READ =>
if(!stopreading) {
n := sys->read(sys->fildes(0), buf, 1);
arena[p] = buf[0];▼
if(n < 1) {
arena[p] = byte 0;
stopreading = 1;
} else {
▲ arena[p] = buf[0];
}
}
WRITE =>
buf[0] = arena[p];
Line 993 ⟶ 1,001:
</lang>
{{out}}
Using the example code from [[Hello world/Text]]:
<pre>% bf '++++++++++[>+>+++>++++>+++++++>++++++++>+++++++++>++
++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>+.>>>
>+..<.<++++++++.>>>+.<<+.<<<<++++.<++.>>>+++++++.>>>.+++.
<+++++++.--------.<<<<<+.<+++.---.'
Goodbye, World!
</pre>
=={{header|Lua}}==
|