-- -*- mode: eiffel -*-
-- $Id: random.se,v 1.3 2001/05/23 18:30:39 doug Exp $
-- http://www.bagley.org/~doug/shootout/

-- <LOC-OFF>
indexing
   description: "This class is the entry point for the random number generation test" 
   author : Steve Thompson
   email  : "Steve_Thompson@prodigy.net"
   date   : February 18, 2001
   compile: "compile -clean -case_insensitive -boost -no_split -O3 main.e -o main"
   run    : "main 900000"
-- <LOC-ON>

class RANDOM
   
creation make
   
feature -- Creation
   
   make is
      local
     random: RANDOMNUMBER
     n: INTEGER
     answer: DOUBLE
     index: INTEGER
      do
     if argument_count = 0 then 
        n := 1
     else
        n := argument(1).to_integer
     end
     from 
        index := n
        !!random.make 
     until index = 0 loop
        answer := random.next(100.0)
        index := index - 1
     end
     io.put_string(answer.to_string_format(9))
     io.put_new_line
      end
   
end