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