1 #ifndef __CRand_HPP__ 2 #define __CRand_HPP__ 3 4 /* "Species" - a CoreWars evolver. Copyright (C) 2003 'Varfar' 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU General Public License as published by the Free 8 * Software Foundation; either version 1, or (at your option) any later 9 * version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 * You should have received a copy of the GNU General Public License along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 20 21 /* the expectation is that, because we are using our own random number generator, 22 * we can start to express warriors as prng vectors relative to a known warrior 23 * when creating warriors on distant nodes in a distributed environment, rather 24 * than needing to send the whole warrior each time. Neat! */ 25 26 class CRand { 27 public: 28 /* random generators return a (0 >= value < max) */ 29 static float frand(const float max); 30 static int irand(const int max); 31 private: 32 }; 33 34 #endif // __CRand_HPP__ 35