progs/matcher/re3.sc
changeset 967 ce5de01b9632
parent 929 9541e073f2ed
equal deleted inserted replaced
966:4189cb63e5db 967:ce5de01b9632
   182   for (i <- 0 to 30 by 5) {
   182   for (i <- 0 to 30 by 5) {
   183     println(f"$i: ${time_needed(1, matcher(EVIL4, "a" * i))}%.5f")
   183     println(f"$i: ${time_needed(1, matcher(EVIL4, "a" * i))}%.5f")
   184   }
   184   }
   185 }
   185 }
   186 
   186 
       
   187 @main
       
   188 def test5() = {
       
   189   println("Test (abcdef){n}")
       
   190   val re = SEQ(CHAR('a'), SEQ(CHAR('b'), SEQ(CHAR('c'), SEQ(CHAR('d'), SEQ(CHAR('e'), CHAR('f'))))))
       
   191 
       
   192   for (i <- 0 to 40000 by 5000) {
       
   193     println(f"$i: ${time_needed(1, matcher(NTIMES(re, i), "abcdef" * i))}%.5f")
       
   194   }
       
   195 }
       
   196 
       
   197 
   187 @arg(doc = "Tests that show not all is hunky-dory, but a solution leads too far afield.")
   198 @arg(doc = "Tests that show not all is hunky-dory, but a solution leads too far afield.")
   188 @main
   199 @main
   189 def fail() = { test3(); test4() } 
   200 def fail() = { test3(); test4(); test5() } 
   190 
   201 
   191 
   202