Hello list,

I currently try to write a new codebase, which features some of merc/rom's 
algorithms, dicerolls, internal rules, etc. in another programming language. 
So, I have a code question about merc/rom's URANGE macro:

#define URANGE(a, b, c)        ((b) < (a) ? (a) : ((b) > (c) ? (c) : (b)))


If I'm not wrong, URANGE can be re-written like this (if not, please correct 
me):

if (b < a)
    return a
else
    if (b > c)
        return c
    else
        return b
    endif
endif

I see that this function gets called by various functions, mainly to generate a 
chance-value, but what is it actually supposed to do? What effect is it 
supposed to generate? And how could I generate a similar chance (or what ever) 
instead of using this function ... ?

TIA,
Ernst Rohlicek jun.
[ [EMAIL PROTECTED] ]


----------------------------------------------------------------
Versendet durch Jet2Web Internet - Webmail (webmail.jet2web.net)

Reply via email to