/*************************************************************************** cactustools.cpp - description ------------------- begin : Mon Apr 10 2000 copyright : (C) 2000 by Alexander Theel email : alex.theel@gmx.net ***************************************************************************/ /*************************************************************************** * * * 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 "cactustools.h" #include CactusTools::CactusTools(){ } CactusTools::~CactusTools(){ } /** * Jeweils 50% Wahrscheinlichkeit für true oder false. */ const bool CactusTools::fifty() { return (rand() % 100 < 50); } /** * it x% Wahrscheinlichkeit true. */ const bool CactusTools::ranPercent(int percent) { return (rand() % 100 < percent); } /** * Zufallszahl innerhalb [min...max] gleichverteilt. */ const int CactusTools::ran(int min,int max) { if (maxy) ? x : y; }