factor/extra/benchmark/random/random.factor

17 lines
392 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 ( -- )
1000000 write-random-numbers ;
MAIN: random-main