-- -*- mode: eiffel -*-
-- $Id: objinst.se,v 1.2 2001/05/23 18:29:50 doug Exp $
-- http://www.bagley.org/~doug/shootout/
-- from Steve Thompson

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

class OBJINST
   
creation make
   
feature -- Creation
   
   make is
      local
     index: INTEGER
     n: INTEGER
     toggle: TOGGLE
     nth_toggle: NTH_TOGGLE
      do
     if argument_count = 0 then 
        n := 1
     else
        n := argument(1).to_integer
     end
     
     !!toggle.make(True)
     from index := 0 until index = 5 loop
        print(toggle.activate.value)
        print("%N")
        index := index + 1
     end
     from index := 0 until index = n loop
        !!toggle.make(True)
        index := index + 1
     end
     
     print("%N")
     
     !!nth_toggle.make(True, 3)
     from index := 0 until index = 8 loop
        print(nth_toggle.activate.value)
        print("%N")
        index := index + 1
     end
     from index := 0 until index = n loop
        !!nth_toggle.make(True, 3)
        index := index + 1
     end
     
      end -- make
   
end