progs/bfc0.scala
changeset 638 e951b9688bb2
parent 637 936560fab865
child 648 a64c9a1007ee
equal deleted inserted replaced
637:936560fab865 638:e951b9688bb2
    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) = {