--- a/progs/bf/bfc0.sc Fri Sep 26 19:09:50 2025 +0100
+++ b/progs/bf/bfc0.sc Fri Sep 26 23:10:52 2025 +0100
@@ -47,10 +47,11 @@
// BF program and running the resulting binary
def compile_and_run(prog: String) = {
- val tn = "tmp"
+ val hash = java.util.UUID.randomUUID().toString.take(4)
+ val tn = s"tmp_$hash"
compile_to_file(s"${tn}.c", prog)
os.proc("gcc", "-O0", "-o", tn, s"${tn}.c").call() // call gcc
- os.proc("./tmp").call(stdout = os.Inherit) // run binary
+ os.proc(os.pwd / s"${tn}").call(stdout = os.Inherit) // run binary
}
// Running Testcases