# HG changeset patch # User Christian Urban # Date 1699306017 0 # Node ID 191cd1de93f1136f3944e59c5f2b5ebbdda08f0d # Parent a4e1f63157d826b52ee957e970244e8c025a4489 updated jars diff -r a4e1f63157d8 -r 191cd1de93f1 core_solution1/collatz.jar Binary file core_solution1/collatz.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_solution2/docdiff.jar Binary file core_solution2/docdiff.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_solution3/postfix.jar Binary file core_solution3/postfix.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_solution3/postfix2.jar Binary file core_solution3/postfix2.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_templates1/collatz.jar Binary file core_templates1/collatz.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_templates2/docdiff.jar Binary file core_templates2/docdiff.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_templates3/postfix.jar Binary file core_templates3/postfix.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 core_templates3/postfix2.jar Binary file core_templates3/postfix2.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/core_cw01.pdf Binary file cws/core_cw01.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/core_cw02.pdf Binary file cws/core_cw02.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/core_cw03.pdf Binary file cws/core_cw03.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/main_cw01.pdf Binary file cws/main_cw01.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/main_cw02.pdf Binary file cws/main_cw02.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/main_cw03.pdf Binary file cws/main_cw03.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/main_cw04.pdf Binary file cws/main_cw04.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 cws/main_cw05.pdf Binary file cws/main_cw05.pdf has changed diff -r a4e1f63157d8 -r 191cd1de93f1 main_solution3/re.jar Binary file main_solution3/re.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 main_solution5/bf.scala --- 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)) diff -r a4e1f63157d8 -r 191cd1de93f1 main_solution5/bfc.scala --- 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) diff -r a4e1f63157d8 -r 191cd1de93f1 main_templates2/wordle.jar Binary file main_templates2/wordle.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 main_templates3/re.jar Binary file main_templates3/re.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 main_templates4/shogun.jar Binary file main_templates4/shogun.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 main_templates5/bf.jar Binary file main_templates5/bf.jar has changed diff -r a4e1f63157d8 -r 191cd1de93f1 main_templates5/bfc.jar Binary file main_templates5/bfc.jar has changed