progs/compile_arr.scala
changeset 712 e71eb9ce2373
parent 710 183663740fb7
--- a/progs/compile_arr.scala	Tue Feb 04 09:31:18 2020 +0000
+++ b/progs/compile_arr.scala	Fri Feb 07 11:32:47 2020 +0000
@@ -452,7 +452,7 @@
   case '0' => s"mem[ptr] := 0;"
   case '+' => s"mem[ptr] := mem[ptr] + $n;"
   case '-' => s"mem[ptr] := mem[ptr] - $n;"
-  case '.' => s"x := mem[ptr]; write x;" 
+  case '.' => s"x := mem[ptr]; write(x);" 
   case '['  => "while (mem[ptr] != 0) do {" * n 
   case ']'  => "skip};" * n
   case _ => ""
@@ -507,7 +507,8 @@
       +++++++++++++++++++++++.[-]]++++++++++<[->-<]>++++
       ++++++++++++++++++++++++++++++++++++++++++++.[-]<<
       <<<<<<<<<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<-[>>.>.<<<
-      [-]]<<[>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-]"""
+      [-]]<<[>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-]
+      [-]++++++++++."""
 
 bf_run(bf2, "fibs")