Created
January 13, 2020 21:48
-
-
Save treeform/038fe8269f149678e199a71fb8c5388d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| OpType = enum Inc, Move, Loop, Print | |
| Ops = seq[Op] | |
| Op = object | |
| case op: OpType | |
| of Inc, Move: val: int | |
| of Loop: loop: Ops | |
| else: discard | |
| StringIterator = iterator(): char | |
| Tape = object | |
| pos: int | |
| tape: seq[int] | |
| Program = distinct Ops | |
| func initTape(): Tape = | |
| result.pos = 0 | |
| result.tape = newSeq[int](1) | |
| proc get(t: Tape): int {.inline.} = t.tape[t.pos] | |
| proc inc(t: var Tape, x: int) {.inline.} = t.tape[t.pos] += x | |
| proc move(t: var Tape, x: int) {.inline.} = | |
| t.pos += x | |
| while t.pos >= t.tape.len: | |
| t.tape.setLen 2 * t.tape.len | |
| func newStringIterator(s: string): StringIterator = | |
| result = iterator(): char = | |
| for i in s: | |
| yield i | |
| func parse(iter: StringIterator): Ops = | |
| for i in iter(): | |
| case i | |
| of '+': result.add Op(op: Inc, val: 1) | |
| of '-': result.add Op(op: Inc, val: -1) | |
| of '>': result.add Op(op: Move, val: 1) | |
| of '<': result.add Op(op: Move, val: -1) | |
| of '.': result.add Op(op: Print) | |
| of '[': result.add Op(op: Loop, loop: parse iter) | |
| of ']': break | |
| else: discard | |
| func parse(code: string): Program = | |
| let iter = newStringIterator code | |
| result = Program parse iter | |
| var output: string | |
| proc run(ops: Ops, t: var Tape) = | |
| for op in ops: | |
| case op.op | |
| of Inc: t.inc op.val | |
| of Move: t.move op.val | |
| of Loop: | |
| while t.get() > 0: run(op.loop, t) | |
| of Print: | |
| output.add t.get().chr() | |
| proc run(ops: Program) = | |
| var tape = initTape() | |
| run Ops ops, tape | |
| echo output | |
| """ | |
| A mandelbrot set fractal viewer in brainf*** written by Erik Bosman | |
| +++++++++++++[->++>>>+++++>++>+<<<<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>>]<<<<<<<<[->>>>>>>>+<<<<<<<<<<<<<<<<<[<<<<<<< | |
| <<]>>>>[-]+>>>>>[>>>>>>>>>]>+<]]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>> | |
| -<<[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+>>>>>>[>>>>>> | |
| >>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++ | |
| +[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<< | |
| <<<<<]]>>>] | |
| """.parse().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment