Advertisement
Guest User

guess what

a guest
Sep 27th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 0.84 KB | None | 0 0
  1. class
  2.     APPLICATION
  3.  
  4. create
  5.     make
  6.  
  7. feature
  8.        make
  9.         do
  10.             across get_smth (100) as ic loop print (ic.item.out + " ") end
  11.         end
  12.  
  13.     get_smth (maxn: INTEGER): LINKED_LIST [INTEGER]
  14.         require
  15.             valid: maxn >= 2
  16.         local
  17.             l_tab: ARRAY [BOOLEAN]
  18.         do
  19.             create Result.make
  20.             create l_tab.make_filled (True, 2, maxn)
  21.             across
  22.                 l_tab as ic
  23.             loop
  24.                 if ic.item then
  25.                     Result.extend (ic.target_index)
  26.                     across ((ic.target_index * ic.target_index) |..| l_tab.upper).new_cursor.with_step (ic.target_index) as id
  27.                     loop
  28.                         l_tab [id.item] := False
  29.                     end
  30.                 end
  31.             end
  32.         end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement