[A83] Re: help!


[Prev][Next][Index][Thread]

[A83] Re: help!




>>I have a question. How do I do a equation like this, I will use it in a 
>>battle engine in an RPG. The problem is that all the numbers are 16-bit. In 
>>this example I use the players strenght and attack values to define a 
>>damage:
>>
>>(PLAYER STRENGHT / 2) + (PLAYER ATTACK) + (int rand(PLAYER ATTACK+1 > 
>>PLAYER ATTACK / 3)

i had this odd thought about evaluating complex expressions, if they only
needed to be called at non-time-critical points.  If you make a little tiny
BASIC prog that simply has the expression as the only line, then the result
gets put in Ans.  So if you had something complex, like x*cos(b/2+5) (-That
was a bad example-), that only needed to get checked, say, when they
initiate an attack, then the BASIC prog would get built and run, then
deleted, and the result would get dumped in Ans.





References: