# HG changeset patch # User Christian Urban # Date 1758924652 -3600 # Node ID 8cb2e171d95236f1ab68bdb56b1f6e6020a7c9e2 # Parent 84401da2e2778d9a93e5c7b914852930d1c28869 updated diff -r 84401da2e277 -r 8cb2e171d952 progs/bf/bfc0.sc --- 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 diff -r 84401da2e277 -r 8cb2e171d952 progs/bf/bfc1.sc --- a/progs/bf/bfc1.sc Fri Sep 26 19:09:50 2025 +0100 +++ b/progs/bf/bfc1.sc Fri Sep 26 23:10:52 2025 +0100 @@ -59,10 +59,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