00001 00002 // Shoot(r) 00009 00010 #include "util.h" 00011 #include <stdlib.h> 00012 00013 // Recherche d'un nombre alléatoire flottant 00014 float RandFloat (float fMin, float fMax) 00015 { 00016 return (rand () / (float)RAND_MAX * (fMax - fMin)) + fMin; 00017 } 00018 00019 // Recherche d'un nombre alléatoire entier 00020 int RandInt (int iMin, int iMax) 00021 { 00022 return (int)(rand () / (float)RAND_MAX * (iMax - iMin)) + iMin; 00023 }
1.3.8