<!-- NOTE : This program is a JavaScript version of Mersenne Twister, conversion from the original program (mt19937ar.c) If you have any questions about this program, please ask me by e-mail. e-mail: support @ 2kbgames.com --> <html><head><title>0AB5@0 =0@4: !1@0AK20=85 :C18:>2</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <script type="text/JavaScript"> /* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ /* Period parameters */ var N = 624; var M = 397; var MATRIX_A = 0x9908b0df; var UPPER_MASK = 0x80000000; var LOWER_MASK = 0x7fffffff; var mt = new Array(N); var p = 0; /* initializes mt[N] with a seed */ function init(seed) { var i; mt[0]= seed >>> 0; for (i=1; i < N; i++) { var s = mt[i-1] ^ (mt[i-1] >>> 30); mt[i] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253) + i; mt[i] >>>= 0; } p = N; } function gen_state() { var i, i1, i397, num; for(i=0; i < N; i++) { i1 = i + 1; i397 = i + M; if(i1 >= N) i1 -= N; if(i397 >= N) i397 -= N; num = (mt[i] & UPPER_MASK) | (mt[i1] & LOWER_MASK); num = mt[i397] ^ (num >>> 1) ^ ((num & 1) ? 0x9908b0df : 0); mt[i] = num; mt[i] >>>= 0; } p = 0; } function rand_int32() { if(p == N) gen_state(); var y = mt[p++]; /* Tempering */ y ^= (y >>> 11); y ^= (y << 7) & 0x9d2c5680; y ^= (y << 15) & 0xefc60000; y ^= (y >>> 18); return y >>> 0; } function generate() { var seed = document.random.seed.value; var count = document.random.count.value; if(seed < 1 || count < 1) { alert("Please enter Seed and Number of Rolls!"); return 0; } if(count > 1000) count = 1000; document.write("<html><head><title>Masters of Backgammon Dice Rolls</title></head><body><a href=''>Back</a><br><br>Seed = " + seed + "<br>Number of Rolls = " + count + "<br><pre>"); init(seed); var i; var c = 0; for (i=0; i < count; i++) { if (i%10==0) { document.write("<br> " + c + ": "); c += 10; } var dice1 = (rand_int32() % 6 + 1); var dice2 = (rand_int32() % 6 + 1); document.write(dice1 + "-" + dice2, " "); } document.write("</pre></body></html>"); return 0; } </script> </head> <body> <table width="100%" height="100%"><tr><td align="center"> <table width="600px"><tr><td> <center><image src="http://2kbgames.com/images/mob_big.jpg"></center> <h3>0: ?@>8AE>48B A1@0AK20=85 :C18:>2?</h3> > 2@5<O 1@>A:0 2 83@5 0AB5@0 =0@4 ?@>3@0<<0 35=5@8@C5B 2 A;CG09=KE 7=0G5=8O >B 1 4> 6 A ?><>ILN 35=5@0B>@0 A;CG09=KE G8A5;. K?02H85 7=0G5=8O <>6=> AG8B0BL A;CG09=K<8. "5< =5 <5=55, A;54C5B >B<5B8BL, GB> 2KG8A;8B5;L=0O B5E=8:0 (:><?LNB5@, B5;5D>= 8;8 ?;0=H5B) 2 =0AB>OI55 2@5<O A?>A>1=0 A35=5@8@>20BL B>;L:> ?A524>A;CG09=K5 G8A;0.<br> <h3>0: @01>B05B 35=5@0B>@ A;CG09=KE G8A5;?</h3>  83@5 0AB5@0 0@4 2A5 :>AB8 35=5@8@CNBAO A ?><>ILN 0;3>@8B<0 A;CG09=KE G8A5; <a href="http://en.wikipedia.org/wiki/Mersenne_twister">Mersenne twister</a>. 0==K9 0;3>@8B< 8A?>;L7C5BAO 2 1>;LH8=AB25 :><?LNB5@=KE ?@>3@0<<, 35=5@8@CNI85 A;CG09=K5 G8A;0, 2 B>< G8A;5 8 4@C38E =0@40E (=0?@8<5@, GNU Backgammon). ;3>@8B< ?@54AB02;O5B A>1>9 @O4 ?A524>A;CG09=KE G8A5; 8 =0G8=05BAO A G8A;>2>3> 7=0G5=8O, :>B>@>5 8<5=C5BAO :0: A5<O (Seed). ! ?><>ILN MB>3> A5<5=8, 0;3>@8B< ?@>872>48B 15A:>=5G=CN ?>A;54>20B5;L=>ABL A;CG09=KE G8A5;. 064>5 A5<O A?>A>1=> 35=5@8@>20BL @07;8G=K5 ?>A;54>20B5;L=>AB8. A;8 2K 7=05B5 A5<O, 2K A<>65B5 2=>2L 2>A?@>8725AB8 B>G=> B0:CN 65 ?>A;54>20B5;L=>ABL A;CG09=KE G8A5;.<br><br> 0640O 83@0 (<0BG) 2 0AB5@0 0@4 =0G8=05BAO A> A2>8< C=8:0;L=K< A5<5=5<.  :0G5AB25 A5<5=8 O2;O5BAO B5:CI55 A8AB5<=>5 2@5<O, 2K@065==>5 2 <8:@>A5:C=40E. -B> 30@0=B8@C5B, GB> 2K =8:>340 =5 A<>65B5 =0G0BL 83@C A B>9 65 ?>A;54>20B5;L=>ABLN :C18:>2.<br> <i>@8<5G0=85: 4;O 8=B5@=5B-83@ 2 :0G5AB25 A5<5=8 8A?>;L7C5BAO =><5@ :><=0BK, :>B>@K9 O2;O5BAO C=8:0;L=K<.</i><br><br> >A;5 >:>=G0=8O 83@K 2 0AB5@0 =0@4 >B>1@0605BAO >:=> A @57C;LB0B0<8, 2 :>B>@>< 5ABL 2>7<>6=>ABL >B:@KBL AB0B8AB8:C ?>A;54=53> <0BG0.  40==>9 AB0B8AB8:5 2K <>65B5 =09B8 A5<O 35=5@0B>@0 A;CG09=KE G8A5; 8 ?@>A<>B@5BL 2AN ?>A;54>20B5;L=>ABL 2K?02H8E :>AB59 2> 2@5<O 83@K. ! ?><>ILN 40==>3> A5<5=8, 2K <>65B5 ?@>25@8BL ?>A;54>20B5;L=>ABL 2K?02H8E :>AB59, GB>1K C1548BL A51O, GB> 1@>A:8 :>AB59 =5 87<5=ONBAO 2 ?>;L7C 20H53> >??>=5=B0. "0:65 2K A<>65B5 C1548BLAO, GB> ?>A;54>20B5;L=>ABL 2K?02H8E :>AB59 >A=>20=0 8A:;NG8B5;L=> =0 A5<5=5, 0 =5 =0 >A=>25 :0:8E-;81> <0E8=0F89 2 83@5 8;8 ?>78F89.<br> <center><image src="images/rng_stat.jpg"></center> KH5 ?@82545= A:@8=H>B 87 83@K. 0: 284=>, A5<5=5< 35=5@0B>@0 O2;O5BAO 7=0G5=85 1759859.  ?>4 =8< C:070= @O4 A45;0==KE 70 83@C 1@>A:>2.<br> <h3>0: A35=5@8@>20BL ?>A;54>20B5;L=>ABL :C18:>2 A ?><>ILN A5<5=8?</h3> 'B>1K A35=5@8@>20BL 1@>A:8 :C18:>2 =0 40==>< A09B5, 22548B5 A5<O 8 :>;8G5AB2> 1@>A:>2 :C18:0. 0B5<, =06<8B5 :=>?:C Submit.<br> @>A:8 :C18:>2 1C4CB 2K2545=K ?> 10 7=0G5=89 2 AB@>:5 A;520 =0?@02>, =0G8=0O A ?5@2>3> 1@>A:0.<br><br> <form name="random"> !5<O = <input type="text" name="seed" id="seed"/></br> >;8G5AB2> 1@>A:>2 = <input type="text" name="count" value="100"/> <input type="button" onclick="generate();" value="Submit"> </form> <br> <h3>0: ?@>25@8BL ?>A;54>20B5;L=>ABL 2K?02H8E :C18:>2 2 83@5?</h3>  >:=5 AB0B8AB8:8 ?>A;54=53> <0BG0 =0948B5 A5<O 8 ?>A;54>20B5;L=>ABL.<br> 2548B5 MB> A5<O =0 MB>9 AB@0=8F5 8 A35=5@8@C9B5 ?>A;54>20B5;L=>ABL :C18:>2 A ?><>ILN A09B0 :0: MB> A:070=> 2KH5. !@02=8B5 ?>A;54>20B5;L=>ABL 2K?02H8E :C18:>2 2 83@5 8 ?>A;54>20B5;L=>ABL 1@>A:>2 =0 40==>< A09B5. -B> ?><>65B 20< C1548BLAO, GB> 1@>A:8 2 83@5 A35=5@8@>20=K AB@>3> ?> 0;3>@8B<C.<br>  :0G5AB25 ?@8<5@0, =865 ?@82545=K A:@8=H>BK.<br> <center><image src="images/rng_check.jpg"></center> <h3>AE>4=K9 :>4 35=5@0B>@0 A;CG09=KE G8A5;</h3> A;8 2K E>B8B5 ?@>A<>B@5BL 8AE>4=KE :>4 35=5@0B>@0 A;CG09=KE G8A5;, :>B>@K9 8A?>;L7C5BAO 2 83@5 0AB5@0 =0@4, 2K <>65B5 A:0G0BL 53> <a href="random_source.zip">745AL</a>.<br> <h3>! :0:>9 F5;LN 1K;0 A>740=0 40==0O AB@0=8F0?</h3> -B0 AB@0=8F0 1K;0 A>740=0 2 ?5@2CN >G5@54L 4;O C4>2;5B2>@5=8O B@51>20=89 B5E ;N459, :>B>@K5 AG8B0NB, GB> 83@0 0AB5@0 =0@4 >1<0=K205B, ?>4:84K205B >??>=5=BC =C6=K5 :>AB8 2 =C6=K9 <><5=B, 2K1@0AK205B A;8H:>< <=>3> 4C1;59. </td></tr></table></td></tr></table> <script type="text/javascript"> window.onload=function(){ function querySt(ji) { hu = window.location.search.substring(1); gy = hu.split("&"); for (i=0;i<gy.length;i++) { ft = gy[i].split("="); if (ft[0] == ji) { return ft[1]; } } } var uc = querySt("seed"); if( uc != null){ document.getElementById('seed').value = uc; } } </script> </body></html>