factor/extra/benchmark/random/random.factor

17 lines
391 B
Factor
Raw Normal View History

USING: io io.files io.files.temp io.encodings.ascii random
math.parser math ;
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 [
2008-02-27 20:24:50 -05:00
[ 200 random 100 - number>string print ] times
] 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