factor/extra/benchmark/random/random.factor

16 lines
378 B
Factor
Raw Normal View History

2008-03-11 22:58:50 -04:00
USING: io.files io.encodings.ascii random math.parser io 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