Mersenne Twister

<?php
    $MT_N = 624;
    $MT_M = 397;
    $MT_UPPER_MASK = 0x80000000;
    $MT_LOWER_MASK = 0x7fffffff;
    $mt = &#91;&#93;;
    $mti = $MT_N + 1;

    // initialize
    function my_mt_srand($seed){
        global $mt, $mti, $MT_N;
        $mt&#91;0&#93; = $seed & 0xfffffff;
        for ($mti = 1; $mti < $MT_N; $mti++){
            $mt&#91;$mti&#93; = (1812433253 * ($mt&#91;$mti-1&#93; ^ ($mt&#91;$mti-1&#93; >> 30)) + $mti);
            $mt[$mti] &= 0xfffffff;
        }
    }
    function my_mt_rand($min, $max){
        $range = $max - $min + 1;
        return (my_mt_genrand_int32() % $range) + $min;
    }
    function my_mt_genrand_int32() {
        global $MT_N, $MT_M, $mt, $mti;
        global $MT_UPPER_MASK, $MT_LOWER_MASK;
        
        static $mag01;
        $mag01 = array(0x0, 0x9908b0df);
        // table initialize
        if ($mti == $MT_N){
            if ($mti == $MT_N + 1) my_mt_srand(time());
            // remake table
            for ($kk = 0; $kk < $MT_N - $MT_M; $kk++){
                $y = ($mt&#91;$kk&#93;&$MT_UPPER_MASK)|($mt&#91;$kk+1&#93;&$MT_LOWER_MASK);
                $mt&#91;$kk&#93; = $mt&#91;$kk+($MT_M-$MT_N)&#93; ^ ($y >> 1) ^ $mag01[$y & 0x1];
            }
            $y = ($mt[$MT_N-1]&$MT_UPPER_MASK)|($mt[0]&$MT_LOWER_MASK);
            $mt[$MT_N-1] = $mt[$MT_M-1] ^ ($y >> 1) ^ $mag01[$y & 0x1];
            $mti = 0;
        }
        $y = $mt[$mti++];
        $y ^= ($y >> 11);
        $y ^= ($y << 7) & 0x9d2c5680;
        $y ^= ($y << 15) & 0xefc60000;
        $y ^= ($y >> 18);
        return $y;
    }

    my_mt_srand(time());
$list = array('●','▲','■','◯','△','□')
    for ($i = 0; $i < 256; $i++){
        $c = $list&#91;my_mt_rand(0, 5)&#93;;
        echo $c;
        if($i % 16 == 15) echo "<br>";
    }