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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bf23cb25158d2486 X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Random Number Generator Date: 1998/11/13 Message-ID: <19981113083018.20046.00000380@ngol02.aol.com>#1/1 X-Deja-AN: 411446679 References: <364C0C41.6CC14A8C@virgin.net> X-Admin: news@aol.com Organization: AOL http://www.aol.com Newsgroups: comp.lang.ada Date: 1998-11-13T00:00:00+00:00 List-Id: "niel.williams" writes: > Has any one got a simple random number > generator prog that generates numbers > between 1-10? If you have an Ada 95 compiler, the answer is simply to use the package Ada.Numerics.Discrete_Random, which comes with the language. This program keeps displaying random integers from 1 to 10: with Ada.Text_IO, Ada.Numerics.Discrete_Random; use Ada.Text_IO; procedure Test is subtype S is Integer range 1 .. 10; package My_Random is new Ada.Numerics.Discrete_Random(S); use My_Random; G : Generator; begin Reset(G); loop Put(Integer'Image(Random(G))); end loop; end Test; If you have an Ada 83 compiler, the answer is much more complicated, but the compiler *may* have come with a package to do what you want. - John Herro You can download a shareware Ada Tutor program at http://members.aol.com/AdaTutor