Ok, so it's REAL late (early) and I'm willing to bet someone has drugged my coffee.
Anyways, I can't get this silly code to work properly. Any suggestions? (should be pretty straightforward)
int BounceFlow (float max, float min, float increment, float current)
{
int RoundTrip=0;
int total=current;
if (current >= max)
RoundTrip = 1;
if (current <= min)
RoundTrip = 0;
if (RoundTrip == 0)
return (total += increment);
if (RoundTrip == 1)
return (total -= increment);
return current;
}
Typicaly the code is supposed to return the variable "current" with the apropriate additions/subtractions.
Thanks in advance,
JarettL
Anyways, I can't get this silly code to work properly. Any suggestions? (should be pretty straightforward)
int BounceFlow (float max, float min, float increment, float current)
{
int RoundTrip=0;
int total=current;
if (current >= max)
RoundTrip = 1;
if (current <= min)
RoundTrip = 0;
if (RoundTrip == 0)
return (total += increment);
if (RoundTrip == 1)
return (total -= increment);
return current;
}
Typicaly the code is supposed to return the variable "current" with the apropriate additions/subtractions.
Thanks in advance,
JarettL