Call y from inside set-mth-ith

cvs
Doug Coleman 2005-10-05 05:49:05 +00:00
parent 5be3e42f30
commit ea58378a57
1 changed files with 4 additions and 4 deletions

View File

@ -30,8 +30,8 @@ SYMBOL: mti
: y ( index -- y ) : y ( index -- y )
dup 1+ mt-nth LO-MASK bitand >r mt-nth HI-MASK bitand r> bitor ; inline dup 1+ mt-nth LO-MASK bitand >r mt-nth HI-MASK bitand r> bitor ; inline
: set-mt-ith ( y index index1 -- ) : set-mt-ith ( index index1 -- )
mt-nth rot dup odd? A 0 ? swap -1 shift bitxor bitxor swap mt get set-nth ; inline >r dup >r y r> r> mt-nth rot dup odd? A 0 ? swap -1 shift bitxor bitxor swap mt get set-nth ; inline
: temper ( y -- yt ) : temper ( y -- yt )
dup -11 shift bitxor dup -11 shift bitxor
@ -40,8 +40,8 @@ SYMBOL: mti
dup -18 shift bitxor ; inline dup -18 shift bitxor ; inline
: generate-new-mt : generate-new-mt
N M - [ dup y over dup M + set-mt-ith ] repeat N M - [ dup over dup M + set-mt-ith ] repeat
M 1- [ dup 227 + dup y over dup M N - + set-mt-ith drop ] repeat M 1- [ dup 227 + dup over dup M N - + set-mt-ith drop ] repeat
0 mti set ; 0 mti set ;
: init-random ( seed -- ) : init-random ( seed -- )