mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-11-16 19:48:56 +01:00
examples: remove a use of as{ }as
FossilOrigin-Name: 3de9369294aec97270d37b626a700ecfa5cafe52c2e7e06739b2ffa61b0bc30c
This commit is contained in:
parent
c3cf3d433e
commit
195dd1859a
1 changed files with 13 additions and 17 deletions
|
@ -12,25 +12,21 @@ XOR/rotate/shift/rotate PNRG (See http://xoshiro.di.unimi.it/)
|
|||
:res** (-n) @s0 #5 * #7 rotl #9 * ;
|
||||
:next (-)
|
||||
@s1 dup #-9 shift push @s3 @s0 @s2
|
||||
as{
|
||||
'pudupoxo i
|
||||
'pupu.... i
|
||||
'pudupoxo i
|
||||
'swposwpo i
|
||||
'dupuxopu i
|
||||
'pudupoxo i
|
||||
'popopoxo i
|
||||
}as
|
||||
\pudupoxo
|
||||
\pupu....
|
||||
\pudupoxo
|
||||
\swposwpo
|
||||
\dupuxopu
|
||||
\pudupoxo
|
||||
\popopoxo
|
||||
!s2 !s1 !s0 #11 rotl !s3 ;
|
||||
|
||||
:xor-er (nananana-nananana)
|
||||
as{
|
||||
'dupufexo i 'pu...... i
|
||||
'dupufexo i 'pu...... i
|
||||
'dupufexo i 'pu...... i
|
||||
'dupufexo i 'pu...... i
|
||||
'popopopo i 'popopopo i
|
||||
}as ;
|
||||
\dupufexo \pu......
|
||||
\dupufexo \pu......
|
||||
\dupufexo \pu......
|
||||
\dupufexo \pu......
|
||||
\popopopo \popopopo ;
|
||||
:jump? (nm-) [ JUMP + fetch ] dip #1 swap n:negate shift and ;
|
||||
:inner (n-n)
|
||||
#32 [ dup I jump? [ [ xor-er ] dip ] if next ] times<with-index> ;
|
||||
|
@ -42,7 +38,7 @@ XOR/rotate/shift/rotate PNRG (See http://xoshiro.di.unimi.it/)
|
|||
:random:xoroshiro128**:jump (-)
|
||||
#0 &s3 #0 &s2 #0 &s1 #0 &s0
|
||||
#4 [ I inner drop ] times<with-index>
|
||||
as{ 'stststst i }as ;
|
||||
\stststst ;
|
||||
|
||||
:random:xoroshiro128**:set-seed (n-)
|
||||
reseed #100 [ next ] times ;
|
||||
|
|
Loading…
Reference in a new issue