progs/bfc0.scala
changeset 638 0367aa7c764b
parent 637 27f71d2755f0
child 648 36379b038438
equal deleted inserted replaced
637:27f71d2755f0 638:0367aa7c764b
    50 // BF program and running the result
    50 // BF program and running the result
    51 import sys.process._
    51 import sys.process._
    52 
    52 
    53 def compile_run(prog: String) = {
    53 def compile_run(prog: String) = {
    54   compile("tmp", prog)
    54   compile("tmp", prog)
    55   "gcc -O0 -o tmp tmp.c".!
    55   "gcc -O3 -o tmp tmp.c".!
    56   "./tmp".!
    56   "./tmp".!
    57   ()
    57   ()
    58 }
    58 }
    59 
    59 
    60 def time_needed[T](n: Int, code: => T) = {
    60 def time_needed[T](n: Int, code: => T) = {