diff -r 99c5916d9a8f -r 7dc3643a0cc5 progs/while-compiler-arrays/compile_bfc.sc --- a/progs/while-compiler-arrays/compile_bfc.sc Mon Aug 17 17:42:37 2020 +0100 +++ b/progs/while-compiler-arrays/compile_bfc.sc Sun Aug 23 23:44:44 2020 +0100 @@ -13,7 +13,7 @@ // * the jasmin assembly file is 236k // * the resulting Java program takes about 20 secs // -// Call with (X being 0,1,..,4) +// Call with (X being 0,1,..,5) // // amm compile_bfc.sc all // amm compile_bfc.sc bfcX @@ -248,23 +248,14 @@ } // a benchmark program (counts down from 'Z' to 'A') -val bf0 = """>++[<+++++++++++++>-]<[[>+>+<<-]>[<+>-]++++++++ - [>++++++++<-]>.[-]<<>++++++++++[>++++++++++[>++ - ++++++++[>++++++++++[>++++++++++[>++++++++++[>+ - +++++++++[-]<-]<-]<-]<-]<-]<-]<-]++++++++++.""" - @doc(" Benchmark 'Z' to 'A'.") @main -def bfc0() = bf_run(bf0, "bench") +def bfc0() = bf_run(read(pwd / "benchmark.bf"), "bench") -// Sierpinski triangle -val bf1 = """++++++++[>+>++++<<-]>++>>+<[-[>>+<<-]+>>]>+[-<<<[ - ->[+[-]+>++>>>-<<]<[<]>>++++++[<<+++++>>-]+<<++.[-]<< - ]>.>+[>>]>+]""" @doc(" Sierpinski triangle.") @main -def bfc1() = bf_run(bf1, "sier") +def bfc1() = bf_run(read(pwd / "sierpinski.bf"), "sier") // Hello World val bf2 = """++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-] @@ -296,159 +287,18 @@ //---------------- // // Note: Parsing of the generated WHILE program (around 60K in size) -// takes approximately 10 minutes to parse with the parser combinators, and -// approximately 30 seconds with fastparse - - -val bf4 = """A mandelbrot set fractal viewer in brainf*** written by Erik Bosman -+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[[ ->>>>>>>>>]+[<<<<<<<<<]>>>>>>>>>-]+[>>>>>>>>[-]>]<<<<<<<<<[<<<<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]<+<<<<<<<<[>>>>>>[->>+<<]<<<<<<<<<<<<<<<]>>>>>>>>>[>>>>>>>>>]<<<<<<<<<[>[-]<- ->>>>>>>>[-<<<<<<<<+>[<->-<<+>>]<[->+<]>>>>>>>>]<<<<<<<[->>>>>>>+<<<<<<<]<+<<<<<< -<<<]>>>>>>>>-<<<<<[-]+<<<]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>>->[>>> ->>>[->>+<<]>>>]<<<<<<<<<[>[-]<->>>>>>>>[-<<<<<<<<+>[<->-<<+>>]<[->+<]>>>>>>>>]<< -<<<<<[->>>>>>>+<<<<<<<]<+<<<<<<<<<]>+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>> -+>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<[<<<<<<<<<]>>>>>>>>>[>>>>>>[-<<<<<<->>>>>>]+< -<<<<<[->>>>>>->>[-<<<<<<<<+>>>>>>>>]<<<<<<<<[->>>>>>>>+<<<<<<<<<<<<<<<<<[<<<<<<< -<<]>>>>[-]+>>>>>[>>>>>>>>>]>+<]]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>> --<<[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+>>>>>>[>>>>>> ->>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++ -+[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<< -<<<<<]]>>>]""" +// takes approximately 10 minutes to parse with our parser combinators, +// and approximately 30 seconds with Ammonite's fastparse. @doc(" Mandelbrot set.") @main -def bfc4() = bf_run(bf4, "mand") +def bfc4() = bf_run(read(pwd / "mandelbrot.bf"), "mand") + + +// this hits the capacity of the JVM, even with optimisations +//@doc(" Coolatz serries up to 30.") +//@main +//def bfc5() = bf_run(read(pwd / "collatz.bf"), "coll") //