]> gitweb.factorcode.org Git - factor.git/blob - extra/benchmark/random/random.factor
Fixing everything for mandatory stack effects
[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 ( -- path )
5     "random-numbers.txt" temp-file ;
6
7 : write-random-numbers ( n -- )
8     random-numbers-path ascii [
9         [ 200 random 100 - number>string print ] times
10     ] with-file-writer ;
11
12 : random-main ( -- )
13     1000000 write-random-numbers ;
14
15 MAIN: random-main