     [ 0 >>i drop ] bi ;
 
 : init-mt-first ( seed -- seq )
-    >r mt-n 0 <array> r>
+    >r mt-n 0 <array> <circular> r>
     HEX: ffffffff bitand 0 pick set-nth ;
 
 : init-mt-formula ( seq i -- f(seq[i]) )

    tuck [ nth mt-hi ] [ nth mt-lo ] 2bi* bitor ; inline

: (mt-generate) ( n mt-seq -- y to from-elt )
    [ >r dup 1+ mt-wrap r> calculate-y ]
    [ >r mt-m + mt-wrap r> nth ]
    [ drop ] 2tri ;

: mt-generate ( mt -- )

: mt-a HEX: 9908b0df ; inline
: mt-hi HEX: 80000000 bitand ; inline
: mt-lo HEX: 7fffffff bitand ; inline

: set-generated ( y from-elt to seq -- )
    >r >r >r [ 2/ ] [ odd? mt-a 0 ? ] bi
