/*************************************************************************** rand.cpp - description ------------------- begin : Die Feb 19 12:20:21 CET 2002 copyright : (C) 2002 by Sven Klauke email : sklauke@wiwi.uni-bielefeld.de Institute of Mathematical Economics (IMW) University of Bielefeld, Germany http://www.wiwi.uni-bielefeld.de/~imw/ I ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include void zufall_ini (void) { srand (time (0)); } int zufall (int range) { if (range <= 0) return 0; else return rand () % (range + 1); }