Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Proper way
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 881 of 909
Post > Topic >>

Proper way

by iso8859-1@[EMAIL PROTECTED] Aug 29, 2007 at 01:01 PM

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?




 3 Posts in Topic:
Proper way
iso8859-1@[EMAIL PROTECTE  2007-08-29 13:01:39 
Re: Proper way
Colin Paul Adams <coli  2007-08-31 12:08:07 
Re: Proper way
iso8859-1@[EMAIL PROTECTE  2007-09-02 23:00:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun May 11 22:56:13 CDT 2008.