// $Id$
-//
+//
// A strong random number generator
//
// Copyright (C) 2006 Allen King
// 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.
+//
+// 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.
+// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the project nor the names of its contributors
// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
+// 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
// 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
+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
#ifndef __RANDOM_GENERATOR__
#define __RANDOM_GENERATOR__
-#include "scripting/random_generator.hpp"
-#include "script_interface.hpp"
-
-class RandomGenerator : public Scripting::RandomGenerator
+class RandomGenerator
{
private:
// Array versions of the above information to make code run faster --
long rand_deg;
long rand_sep;
long *end_ptr;
+ int debug;
+ static const int rand_max = 0x7fffffff; // biggest signed Uint32
public:
RandomGenerator();
// generate random 31-bit numbers
// calls to the following return a value evenly distributed between u (or
- // 0 if not specified) and v (or RAND_MAX if not specified). Return
+ // 0 if not specified) and v (or rand_max if not specified). Return
// values may include u, but never v.
int rand();
int rand(int v);