- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
#include <time.h>
int rrand(int start, int end)
{
int range=end-start+1;
int speed=1;
int base=0;
int rez=start;
if(range>200) speed=range/100;
while(range>=0)
{
srand(clock());
if(rand()%2) base=base+speed+1;
else base--;
rez=rez+base;
rez=(rez < start)? end-rez : rez;
rez=(rez > end)? (rez%end)+start : rez;
range=range-speed;
}
return rez;
}