main_solution3/re.scala
changeset 400 e48ea8300b2d
parent 396 3ffe978a5664
child 418 fa7f7144f2bb
--- a/main_solution3/re.scala	Sat Nov 06 00:06:39 2021 +0000
+++ b/main_solution3/re.scala	Mon Nov 08 00:17:50 2021 +0000
@@ -155,8 +155,8 @@
 //println(size(der('a', der('a', der('a', EVIL)))))   // => 58
 
 // size with simplification
-//println(simp(der('a', der('a', EVIL))))          // => 8
-//println(simp(der('a', der('a', der('a', EVIL)))))// => 8
+//println(simp(der('a', der('a', EVIL))))          
+//println(simp(der('a', der('a', der('a', EVIL)))))
 
 //println(size(simp(der('a', der('a', EVIL)))))           // => 8
 //println(size(simp(der('a', der('a', der('a', EVIL)))))) // => 8
@@ -173,11 +173,11 @@
   val start = System.nanoTime()
   for (j <- 1 to i) code
   val end = System.nanoTime()
-  (end - start)/(i * 1.0e9)
+  "%.5f".format((end - start)/(i * 1.0e9))
 }
 
 //for (i <- 0 to 5000000 by 500000) {
-//  println(i + " " + "%.5f".format(time_needed(2, matcher(EVIL, "a" * i))) + " secs.") 
+//  println(s"$i ${time_needed(2, matcher(EVIL, "a" * i))} secs.") 
 //}
 
 // another "power" test case 
@@ -187,7 +187,7 @@
 //
 //      SEQ(SEQ(SEQ(..., ONE | ONE) , ONE | ONE), ONE | ONE)
 //
-//    where SEQ is nested 100 times.
+//    where SEQ is nested 50 times.