gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gforth] how to build a really working random seed ?


From: mhx
Subject: [gforth] how to build a really working random seed ?
Date: Sun, 16 Jul 2017 19:01:46 +0200
User-agent: Roundcube Webmail/1.2.4

Francois Pussault writes:
I found a procedure:
[..]

That seems to be an experiment in how many stack errors and
fundamental flaws can be packed in a single definition. Where
did you find that?

Adding some swaps and fixing the 32/64 incompatibility may fix
this shiftregister based algorithm, but better throw it away
altogether.

By reading the coding it is obvious that when the 'register'
encounters a zero it will stick there. In this case you didn't
execute randomize, so it sticks right away.

I think Gforth has random ( u1 -- u2 ), and 2 CHOOSE should
work for a 1/0 sequence (or 2 choose invert).

-marcel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]