Цитата(Grivus @ 16 Jun 2010, 18:17)
Внимание вопрос: Gray, а во что ты веришь? В справедливый рандом или перекошенный?
В перекошенный.
Для инфы:
Код
/*
* C library functions for generating pseudorandom numbers using the
* Mersenne Twist algorithm. See M. Matsumoto and T. Nishimura,
* "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform
* Pseudo-Random Number Generator", ACM Transactions on Modeling and
* Computer Simulation, Vol. 8, No. 1, January 1998, pp 3--30.
*
* The Web page on the Mersenne Twist algorithm is at:
*
* http://www.math.keio.ac.jp/~matumoto/emt.html
*
* These functions were written by Geoffrey H. Kuenning, Claremont, CA.
*
* IMPORTANT NOTE: the Makefile must define two machine-specific
* variables to get optimum features and performance:
*
* MT_NO_INLINE should be defined if the compiler doesn't support
* the "inline" keyword.
* MT_NO_LONGLONG should be defined if the compiler doesn't support a
* "long long" type for 64-bit integers
* MT_MACHINE_BITS must be either 32 or 64, reflecting the natural
* size of the processor registers. If undefined, it
* will default to 32.
*
* The first two variables above are defined in an inverted sense
* because I expect that most compilers will support inline and
* long-long. By inverting the sense, this common case will require
* no special compiler flags.
*
* IMPORTANT NOTE: this software assumes that the inherent width of a
* "long" is 32 bits. If you are running on a machine that uses
* 64-bit longs, some of the declarations and code will have to be
* modified.
*
* This software is based on LGPL-ed code by Takuji Nishimura. It has
* also been heavily influenced by code written by Shawn Cokus, and
* somewhat influenced by code written by Richard J. Wagner. It is
* therefore also distributed under the LGPL:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. You should have
* received a copy of the GNU Library General Public License along
* with this library; if not, write to the Free Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: mtwist.c,v 1.3 2007/08/06 15:52:21 graymage Exp $
*/