[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gforth] how to build a really working random seed ?
From: |
Francois Pussault |
Subject: |
Re: [gforth] how to build a really working random seed ? |
Date: |
Sun, 16 Jul 2017 19:24:03 +0200 (CEST) |
don't know where I found it exactly ... google as for all I ever need when I
failed to build a word by myself
:)
OK so there are .fs file to be called with include.....
I missed that all !
:D
Gforth 0.7.2, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
include /usr/share/gforth/0.7.2/random.fs ok
: 10rnd 10 0 do 10 random . ." " loop cr ; ok
10rnd 0 0 0 1 7 9 8 9 0 2
ok
Of course now all would be easier to understand. :)
thanks a lot !!
so I m going to study what's in my /usr/share/gforth/0.7.2/*fs files :)
> ----------------------------------------
> From: <address@hidden>
> Sent: Sun Jul 16 19:01:46 CEST 2017
> To: <address@hidden>
> Subject: [gforth] how to build a really working random seed ?
>
>
> 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
>
>
Cordialement
Francois Pussault
10 chemin de négo saoumos
apt 202 - bat 2
31300 Toulouse
+33 6 17 230 820
address@hidden