/[enigma]/enigma/src/enigma.cc
ViewVC logotype

Diff of /enigma/src/enigma.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by ant_39, Sun Jun 8 10:15:14 2003 UTC revision 1.24 by dheck, Thu Jun 26 17:16:45 2003 UTC
# Line 551  enigma::GetImage(const char *name) Line 551  enigma::GetImage(const char *name)
551      Surface *s = image_cache.get(filename);      Surface *s = image_cache.get(filename);
552      return s;      return s;
553  }  }
554    
555    
556    //----------------------------------------
557    // Random numbers
558    //----------------------------------------
559    void   enigma::Randomize (unsigned seed)
560    {
561        srand (seed);
562    }
563    
564    int    enigma::IntegerRand (int min, int max)
565    {
566        int r = int((max-min+1) * (rand()/(RAND_MAX+1.0)));
567        return r+min;
568    }
569    
570    double enigma::DoubleRand (double min, double max)
571    {
572        return min + double(rand())/RAND_MAX * (max-min);
573    }

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26