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

Re: Intent to package rolldice, blackjack



-----BEGIN PGP SIGNED MESSAGE-----

> On Thu, Jan 21, 1999 at 04:04:20AM -0500, Stevie Strickland wrote:
> > rolldice is a virtual dice roller that takes in a string on the command
> > line in the format used by some fantasy role playing games like Advanced
> > Dungeons & Dragons[1] and returns the result of the dice rolls.
> 
> Just wondering, what's the output like and does it return for d10 0-9 or
> 1-10?  Does it handle "d%"?  Is the number of dice optional or must one
> feed it "1d8" for example?  Does it return the results of each die or the
> total rolled or both?  Can you give it something like "2d8 d12 3d6" and
> get a nice formatted output?  Am I asking too many questions?  =>

Eeeeeek!  Let me see if I can answer your questions in order...

Returns 1-10 (I add 1 to num_sides * (rand() / (RAND_MAX + 1.0)) :)

Handles d%?  Oh, just put in d100 for right now, but I'll add that in :)

Number of dice right now is not optional, but could easily be fixed to
default to one... :)

Just total, decided that was the important part (if you ask for 3d6,
you're only interested in the result, unless you're doing something
like method IV of rolling characters in AD&D (I believe), in which you
roll 4d6 and take the highest three, in which case do 4x1d6 :)

No, only handles the first string, I think... let me try it:
midkemia:~$ rolldice 2d8 1d12 3d6
13 

Nope, only first string, but I could just have it loop through the
non-option arguments, as well :)

For your final question... no, I'm always glad to answer them, especially
since they usually give me things to think about as to new features :)

Stevie

- -- 
Stevie Strickland (PGP ID = 23A6D909)	325912 Georgia Tech Station
sstrickl@resnet.gatech.edu		Georgia Institute of Technology
http://computersprache.net/~sstrickl	Atlanta, GA 30332
PGP Key fingerprint = 84 52 C7 EA E6 DB A1 C5  6A C9 D6 B9 88 26 74 FC

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3a
Charset: noconv

iQCVAwUBNqeAhYXKvMsjptkJAQHm6wP8C0ogTowH25iN31WY9UY+1mR/1lealBK3
8tdkeBU2nluVc79dKZ5YYVG1mL1y2QAaRjrcPmAfUctRg1RSEIWBpND1Umxc6SEk
MEtvUruJOvNzih2gUXRbBGEnl+eK5804GdMiO7XXF6MApwjfngHELW5XH8dU89xx
7uj1YzZ/GEs=
=nED1
-----END PGP SIGNATURE-----


Reply to: