diff -r 38ea26f227af -r c51305a2217f solutions5/bfc.scala
--- a/solutions5/bfc.scala Thu Dec 06 18:37:17 2018 +0000
+++ b/solutions5/bfc.scala Thu Dec 06 18:50:53 2018 +0000
@@ -1,7 +1,7 @@
// Part 2 about a "Compiler" for the Brainf*** language
//======================================================
-//object CW10b {
+object CW10b {
// !!! Copy any function you need from file bf.scala !!!
//
@@ -254,7 +254,7 @@
def spl(s: String) = splice(s.toList, Nil).reverse
-spl(load_bff("benchmark.bf"))
+//spl(load_bff("benchmark.bf"))
def combine(s: String) : String = {
(for ((c, n) <- spl(s)) yield c match {
@@ -267,7 +267,7 @@
}
-combine(load_bff("benchmark.bf"))
+//combine(load_bff("benchmark.bf"))
def compute4(pg: String, tb: Map[Int, Int], pc: Int, mp: Int, mem: Mem) : Mem = {
if (0 <= pc && pc < pg.length) {
@@ -295,8 +295,8 @@
compute4(pg_opt, jtable(pg_opt), 0, 0, m)
}
-
-combine(optimise(load_bff("benchmark.bf"))) // => """>A+B[A-A] """>A+B[A-A]