Sorry for double posting but I made a more advanced version.
Just increase type to have it have a skinnier bell. 2 is the same as the old random bell.
int randomBell(int a,int b, int type)
{
int result;
int offset;
int multi = 1;
if(a > b)
{
result = b;
b = a;
a = result;
}
if(a < 0)
{
if(b < 0)
{
result = b;
b = a * (0-1);
a = result * (0-1);
multi = 0-1;
}
else
{
offset = a;
a = 0;
b = b - offset;
}
}
result = 0;
int i;
int a_odd = a%type;
int b_odd = b%type;
for(i = 0; i =< type; i++)
{
result += Random(a/type + lessthan(i,a_odd),b/type + lessthan(i,b_odd));
}
return (result + offset * multi);
}
int lessthan(int a, int b)
{
if(a < b)
{
return 1;
}
return 0;
}
now works with neg numbers :)