--- a/solutions5/bf.scala Thu Dec 06 13:15:28 2018 +0000
+++ b/solutions5/bf.scala Thu Dec 06 13:52:50 2018 +0000
@@ -1,7 +1,7 @@
// Part 1 about an Interpreter for the Brainf*** language
//========================================================
-object CW10a {
+object CW10a { // only for generating the Jar file
type Mem = Map[Int, Int]
@@ -70,15 +70,15 @@
//jumpRight("""--[..[[-]+>[.]]--,>,++""", 3, 0) // => 22 (outside)
//jumpLeft("""[******]***""", 7, 0) // => -1 (outside)
-// (4) Complete the compute function that interpretes (runs) a brainf***
-// program: the arguments are a program (represented as a string), a program counter,
-// a memory counter and a brainf*** memory. It Returns the
-// memory at the stage when the excution of the brainf*** program
+// (4) Complete the compute function that interprets (runs) a brainf***
+// program: the arguments are a program (represented as a string), a program
+// counter, a memory counter and a brainf*** memory. It Returns the
+// memory at the stage when the execution of the brainf*** program
// finishes. The interpretation finishes once the program counter
// pc is pointing to something outside the program string.
// If the pc points to a character inside the program, the pc,
// memory pointer and memory need to be updated according to
-// rules of the brainf*** language. Then, recursively, run
+// rules of the brainf*** language. Then, recursively, the compute
// function continues with the command at the new program
// counter.
// Implement the run function that calls compute with the program
@@ -200,6 +200,8 @@
// a Mandelbrot set generator in brainf*** written by Erik Bosman
+// (http://esoteric.sange.fi/brainfuck/utils/mandelbrot/)
+
run(load_bff("mandelbrot.bf"))
@@ -220,5 +222,4 @@
time_needed(1, run(b1))
*/
-
}