]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/random/random.factor
Factor source files should not be executable
[factor.git] / extra / benchmark / random / random.factor
1 USING: io io.files io.files.temp io.encodings.ascii random
2 math.parser math ;
3 IN: benchmark.random
4
5 : random-numbers-path ( -- path )
6     "random-numbers.txt" temp-file ;
7
8 : write-random-numbers ( n -- )
9     random-numbers-path ascii [
10         [ 200 random 100 - number>string print ] times
11     ] with-file-writer ;
12
13 : random-main ( -- )
14     300000 write-random-numbers ;
15
16 MAIN: random-main