mardi 30 octobre 2018

Gforth random generator has no seed

The following program in gforth prints out 10 random numbers between 0 and 2:

require random.fs
: main 10 0 do i cr . 3 random . loop ;
main

The problem is, that after each start, the numbers are the same. That means no time(0) seed was used. How can i get random numbers which are different on each start?




Aucun commentaire:

Enregistrer un commentaire