Anonymous user
Execute Brain****/D: Difference between revisions
Version 2 D updated
(Version 1 updated) |
(Version 2 D updated) |
||
Line 99:
}</lang>
==
<lang d>import core.stdc.stdio
void brainfuckRun(
static
}▼
}
assert(!loopStack.length);▼
return loops;▼
}
static void runCode(const string code, const int[int] loops) {▼
}
enum char empty = '\0';
char[30_000] tape = empty;
Line 146 ⟶ 145:
case '.': putchar(tape[cell]); break;
case ',':
immutable int c = getchar();
if (c == EOF)
exit(1);
Line 159 ⟶ 158:
index = loops[index];
break;
default:
}
Line 172:
void main() {
brainfuckRun("++++++++++[>+++++++>++++++++++>+++>+<<<<-]
>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.
+++.------.--------.>+.>.");
}</lang>
|