From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4231869cc877ceb9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-26 00:35:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: random number generation References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.124.41 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc52.ops.asp.att.net 1064561710 12.234.124.41 (Fri, 26 Sep 2003 07:35:10 GMT) NNTP-Posting-Date: Fri, 26 Sep 2003 07:35:10 GMT Organization: Comcast Online Date: Fri, 26 Sep 2003 07:35:10 GMT Xref: archiver1.google.com comp.lang.ada:42971 Date: 2003-09-26T07:35:10+00:00 List-Id: >I need to write a program to randomly grab a integer from 1 - 4,and >Does this exist in Ada? type Options is range 1 .. 4; package Generate_Options is new Ada.Numerics.Discrete_Random(Options); A_Generator : Generate_Options.Generator; ... X := Generate_Options.Random(A_Generator); Ada.Text_IO.Put_Line("Selected option is" & Options'image(X)); You could of course replace type Options with type Suits is (Spades, Hearts, Diamonds, Clubs); and have several Dealers instead of a single A_Generator, and so forth. > I don't believe it does from what I have been reading. What have you been reading? If your book doesn't cover random number generation, you can go to the authoritative source, section A.5.2 of the Ada 95 Reference Manual (available online).