Bill,
Thanks for your defence but I'm afraid M.H. Avegaart is correct. Random(n)
returns the result 0 .. n - 1. The problem wasn't quite as simple as some
seemed to think.
Chris Burrows
CFB Software
http://www.cfbsoftware.com.au
"James Roberts" <me@privacy.net> wrote in message
news:3ADED429.1C9CDC4A@privacy.net...
> Wouldn't the results of Random(5) be 0 through 5? If so, then
> Random(5)+1 would yield 1 through 6.
>
> Bill Braun
>
>
> "M.H. Avegaart" wrote:
> >
> > Last time I checked dice had 6 sides (at least the most common ones), so
the
> > code should be:
> >
> > DieThrow := Random(6) + 1;
> >
> > "CFB Software" <info@cfbsoftware.com.au> schreef in bericht
> > news:3ade7bdb@news.iprimus.com.au...
> > > Randomize; // Call once only to initialise
> > > ....
> > > ....
> > > DieThrow := Random(5) + 1;
> > >
> > > Each execution of this statement will assign a random number in the
range
> > 1
> > > to 6 to DieThrow if that is what you are trying to do,
> > >
> > > Chris Burrows
> > > CFB Software
> > >
http://www.cfbsoftware.com.au
> > >
> > > "Maarten" <mvddonk@wish.nl> wrote in message
> > > news:987631802.275373@news.l3.wish.net...
> > > > Can anyone help me with this program i'm trying to make !?
> > > > The idea of the program is to simulatie the throwing of a die.
> > > > Can anyone help me?
> > > > Thanks !!
> > > >
> > > > -------------------DUTCH-------------------
> > > > Kan iemand mij helpen met het maken van een programma !?
> > > > Het idee is om een programma te maken wat het gooien van een
dobbelsteen
> > > > simuleerd.
> > > > Alvast bedankt !!
> > > > -------------------DUTCH-------------------
> > > >
> > > >
> > >
> > >