factor/extra/benchmark/random/random.factor

17 lines
401 B
Factor
Raw Normal View History

USING: io io.files io.files.temp io.encodings.ascii random
2010-01-14 13:08:22 -05:00
math.parser math sequences ;
2008-02-27 20:24:50 -05:00
IN: benchmark.random
: random-numbers-path ( -- path )
"random-numbers.txt" temp-file ;
2008-02-27 20:24:50 -05:00
: write-random-numbers ( n -- )
2008-03-11 22:58:50 -04:00
random-numbers-path ascii [
[ 200 random 100 - number>string print ] times
2008-02-27 20:24:50 -05:00
] with-file-writer ;
: random-main ( -- )
2009-04-17 18:55:01 -04:00
300000 write-random-numbers ;
2008-02-27 20:24:50 -05:00
MAIN: random-main