Hi,
I'm getting my feet wet with eiffel and I try to program some rpg-
utilities for a start. For this I need some kind of dice-roller that
takes Expressions of the form <count>d<sides>+offset and calculates
them.
I managed to create some kind of die that uses the procedure roll to
roll a die and then a query d(side : Integer) to get the result
interpreted as an appropriate die.
But how do I design the dice roller for these complexer expressions?
In Java I would just do something like
roll(count, side, offset : Integer) : Integer but that would change
the internal state of the object. How do I seperate the queries from
the commands cleanly in this case? Could someone give me an idea?