Skip to content

Commit 9382d99

Browse files
Fix brainfuck compiled programs
1 parent 9bfe206 commit 9382d99

File tree

6 files changed

+250
-123
lines changed

6 files changed

+250
-123
lines changed

bfowo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def _convert(self, opcode):
6262
self._out('get;')
6363
self._number(opcode.value)
6464
self._out('add;')
65+
self._wrap()
6566
self._out('store;')
6667
elif opcode.code == OPCODE_SUB:
6768
self._move(opcode.move)
@@ -137,7 +138,6 @@ def _number(self, number):
137138

138139
def _wrap(self):
139140
if self.wrapping:
140-
self._out('add;')
141141
self._number(256)
142142
self._out('mod;')
143143

examples/brainfuck_interpreter.bf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
[<->[<<+>>-]]]<[>+<-]>]>[>]>]>[>>]>>]<<[>>+>>+>>]<<[->>>>>>>>]<<[>.>>>>>>>]<<[
66
>->>>>>]<<[>,>>>]<<[>+>]<<[+<<]<]
77
[input a brainfuck program and its input, separated by an exclamation point.
8-
Daniel B Cristofani (cristofdathevanetdotcom)
8+
Daniel B Cristofani (cristofdathevanetdotcom)!
99
http://www.hevanet.com/cristofd/brainfuck/]

examples/brainfuck_interpreter.owo

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)