Slimelite BBS

Support Group

Back to EMULATE

From Brian Wisti · 1996-04-12 15:57 · #73700 in EMULATE

-> Actually - I might be able to give you some suggestions, but after
-> looking over your class several times, I'm still not sure exactly
-> what its supposed to do. Is the notation system 0-9, A-Z used
-> somehow internally by the game, or is it only used for input/output
-> purposes? If it's only used for I/O, you probably don't need a
-> special class for storing it - regular integers would do the trick.

The integer value of Rating is used internally: the user would never see
it. I made it a separate class partly because I thought it would make my
job easier (allowing users to work with it like a built-in type), and
partly for the practice at creating my own data types.

The program uses the notation system for I/O (including a string which
is a chain of char's obtained from Rating). Some of the values actually
have no meaning in a numerical context, but those could probably be
replaced by char's if a more efficient system of handling Rating was
available.

I just remembered another purpose for Rating. I wanted the main program
to be quite legible to anybody who was familiar with the game Traveller,
and creating a single class which effectively hid a lot of the functions
for a score's inner workings from view did just that. I was able to
write lines like:

Rating Size = roll(2,6,-2);//roll is equivalent to die-rolling
                           //roll(# of dice, max result per die,
                           // modifiers to final value)
Rating Atmos = Size +  roll(2,6,-7);

Looking at it, I suppose I could've just used integers and made a
function for converting it to Traveller notation. But it was so fun!

Last but not least, I'd be very curious to see your fixed-point class.
Part of the program will probably include distances between systems, and
doubtless I'll occasionally want to know crazy things like "Exactly how
far is that in meters?"

--- WILDMAIL!/WC v4.12 
 * Origin: R-Squared BBS, Oly WA USA, 33k6bps, 360-705-4475  (1:352/28.0)