in reply to Re: Dice calcs?
in thread Dice calcs?
I did find a few bugs in your solution. I realize your code was just an example, and I appreciate the insight, I just want to make sure anyone that downloads it realizes there are issues. For example, your code wouldn't allow for multiple @[] operators at the same level (i.e. &3>4@[1d6]+&1>4@[1d100]). Division should be integer. Negative numbers (and thus unary -) need to be implemented. There's no general syntax checking.
I went ahead with the in-place substitution idea and should have some code ready to post soon. I've addressed all of the above issues and a few more. There are still issues with precedence lists, though.... with this method it is impossible/difficult for operators to share the same precedence. For example, normally something like 5*20/3*3 should equal 99, but in this case it comes up 11 (100/9). That's not a problem as long as it's documented.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Dice calcs?
by BigLug (Chaplain) on Sep 19, 2002 at 04:17 UTC | |
by Anonymous Monk on Sep 19, 2002 at 14:11 UTC |