updated jars
authorChristian Urban <christian.urban@kcl.ac.uk>
Mon, 06 Nov 2023 21:26:57 +0000
changeset 478 191cd1de93f1
parent 477 a4e1f63157d8
child 479 6889d9d441ed
updated jars
core_solution1/collatz.jar
core_solution2/docdiff.jar
core_solution3/postfix.jar
core_solution3/postfix2.jar
core_templates1/collatz.jar
core_templates2/docdiff.jar
core_templates3/postfix.jar
core_templates3/postfix2.jar
cws/core_cw01.pdf
cws/core_cw02.pdf
cws/core_cw03.pdf
cws/main_cw01.pdf
cws/main_cw02.pdf
cws/main_cw03.pdf
cws/main_cw04.pdf
cws/main_cw05.pdf
main_solution3/re.jar
main_solution5/bf.scala
main_solution5/bfc.scala
main_templates2/wordle.jar
main_templates3/re.jar
main_templates4/shogun.jar
main_templates5/bf.jar
main_templates5/bfc.jar
Binary file core_solution1/collatz.jar has changed
Binary file core_solution2/docdiff.jar has changed
Binary file core_solution3/postfix.jar has changed
Binary file core_solution3/postfix2.jar has changed
Binary file core_templates1/collatz.jar has changed
Binary file core_templates2/docdiff.jar has changed
Binary file core_templates3/postfix.jar has changed
Binary file core_templates3/postfix2.jar has changed
Binary file cws/core_cw01.pdf has changed
Binary file cws/core_cw02.pdf has changed
Binary file cws/core_cw03.pdf has changed
Binary file cws/main_cw01.pdf has changed
Binary file cws/main_cw02.pdf has changed
Binary file cws/main_cw03.pdf has changed
Binary file cws/main_cw04.pdf has changed
Binary file cws/main_cw05.pdf has changed
Binary file main_solution3/re.jar has changed
--- a/main_solution5/bf.scala	Mon Nov 06 14:18:26 2023 +0000
+++ b/main_solution5/bf.scala	Mon Nov 06 21:26:57 2023 +0000
@@ -96,11 +96,8 @@
       case '+' => (pc + 1, mp, write(mem, mp, sread(mem, mp) + 1))
       case '-' => (pc + 1, mp, write(mem, mp, sread(mem, mp) - 1))
       case '.' => { print(sread(mem, mp).toChar); (pc + 1, mp, mem) }
-      case '['  => 
-	      if (sread(mem, mp) == 0) (jumpRight(prog, pc + 1, 0), mp, mem) else (pc + 1, mp, mem) 
-      case ']'  => 
-	      if (sread(mem, mp) != 0) (jumpLeft(prog, pc - 1, 0), mp, mem) else (pc + 1, mp, mem) 
- 
+      case '['  => if (sread(mem, mp) == 0) (jumpRight(prog, pc + 1, 0), mp, mem) else (pc + 1, mp, mem) 
+      case ']'  => if (sread(mem, mp) != 0) (jumpLeft(prog, pc - 1, 0), mp, mem) else (pc + 1, mp, mem) 
       case _ => (pc + 1, mp, mem)
     }		     
     compute(prog, new_pc, new_mp, new_mem)	
@@ -220,4 +217,4 @@
 //M5a.run(M5a.load_bff("collatz.bf"))
 
 //println(M5a.generate("ABC".toList))
-//M5a.run(M5a.generate("Hello World\n".toList))
\ No newline at end of file
+//M5a.run(M5a.generate("Hello World\n".toList))
--- a/main_solution5/bfc.scala	Mon Nov 06 14:18:26 2023 +0000
+++ b/main_solution5/bfc.scala	Mon Nov 06 21:26:57 2023 +0000
@@ -60,10 +60,8 @@
       case '+' => (pc + 1, mp, write(mem, mp, sread(mem, mp) + 1))
       case '-' => (pc + 1, mp, write(mem, mp, sread(mem, mp) - 1))
       case '.' => { print(sread(mem, mp).toChar); (pc + 1, mp, mem) }
-      case '['  => 
-	if (sread(mem, mp) == 0) (jumpRight(prog, pc + 1, 0), mp, mem) else (pc + 1, mp, mem) 
-      case ']'  => 
-	if (sread(mem, mp) != 0) (jumpLeft(prog, pc - 1, 0), mp, mem) else (pc + 1, mp, mem) 
+      case '['  => if (sread(mem, mp) == 0) (jumpRight(prog, pc + 1, 0), mp, mem) else (pc + 1, mp, mem) 
+      case ']'  => if (sread(mem, mp) != 0) (jumpLeft(prog, pc - 1, 0), mp, mem) else (pc + 1, mp, mem) 
       case _ => (pc + 1, mp, mem)
     }		     
     compute(prog, new_pc, new_mp, new_mem)	
@@ -143,10 +141,8 @@
       case '+' => (pc + 1, mp, write(mem, mp, sread(mem, mp) + 1))
       case '-' => (pc + 1, mp, write(mem, mp, sread(mem, mp) - 1))
       case '.' => { print(sread(mem, mp).toChar); (pc + 1, mp, mem) }
-       case '['  => 
-	if (sread(mem, mp) == 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
-      case ']'  => 
-	if (sread(mem, mp) != 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
+      case '['  => if (sread(mem, mp) == 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
+      case ']'  => if (sread(mem, mp) != 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
       case _ => (pc + 1, mp, mem)
     }		     
     compute2(pg, tb, new_pc, new_mp, new_mem)	
@@ -191,10 +187,8 @@
       case '+' => (pc + 1, mp, write(mem, mp, sread(mem, mp) + 1))
       case '-' => (pc + 1, mp, write(mem, mp, sread(mem, mp) - 1))
       case '.' => { print(sread(mem, mp).toChar); (pc + 1, mp, mem) }
-      case '['  => 
-	if (sread(mem, mp) == 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
-      case ']'  => 
-	if (sread(mem, mp) != 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
+      case '['  => if (sread(mem, mp) == 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
+      case ']'  => if (sread(mem, mp) != 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
       case _ => (pc + 1, mp, mem)
     }		     
     compute3(pg, tb, new_pc, new_mp, new_mem)	
@@ -278,10 +272,8 @@
       case '+' => (pc + 2, mp, write(mem, mp, sread(mem, mp) + (pg(pc + 1) - '@')))
       case '-' => (pc + 2, mp, write(mem, mp, sread(mem, mp) - (pg(pc + 1) - '@')))
       case '.' => { print(sread(mem, mp).toChar); (pc + 1, mp, mem) }
-       case '['  => 
-	if (sread(mem, mp) == 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
-      case ']'  => 
-	if (sread(mem, mp) != 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
+      case '['  => if (sread(mem, mp) == 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
+      case ']'  => if (sread(mem, mp) != 0) (tb(pc), mp, mem) else (pc + 1, mp, mem) 
       case _ => (pc + 1, mp, mem)
     }		     
     compute4(pg, tb, new_pc, new_mp, new_mem)	
Binary file main_templates2/wordle.jar has changed
Binary file main_templates3/re.jar has changed
Binary file main_templates4/shogun.jar has changed
Binary file main_templates5/bf.jar has changed
Binary file main_templates5/bfc.jar has changed