File: example1.e

package info (click to toggle)
smarteiffel 1.1-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 12,288 kB
  • ctags: 40,785
  • sloc: ansic: 35,791; lisp: 4,036; sh: 1,783; java: 895; ruby: 613; python: 209; makefile: 115; csh: 78; cpp: 50
file content (44 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class EXAMPLE1

creation make

feature

   make is
      local
         count, range, column: INTEGER;
      do
         io.put_string("Using the MIN_STAND random number generator.%N%
                       %How many numbers ? ");
         io.read_integer;
         count := io.last_integer;
         io.put_string("Range ( > 1)     ? ");
         io.read_integer;
         range := io.last_integer;
         from
         until
            count = 0
         loop
            random_generator.next;
            io.put_integer(random_generator.last_integer(range));
            count := count - 1;
            if column = 6 then
               io.put_string("%N");
               column := 0;
            else
               column := column + 1;
               io.put_string("%T");
            end;
         end;
         io.put_string("%N");
      end;

feature {NONE}

   random_generator: MIN_STAND is
      once
         !!Result.make;
      end;

end -- EXAMPLE1