Advertisement
PhilDrummer

Assignment_7 04 APPLICATION.e

Nov 19th, 2014
3,588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 0.81 KB | None | 0 0
  1. class
  2.     APPLICATION
  3.  
  4. create
  5.     make
  6.  
  7. feature
  8.  
  9.     make
  10.             -- Launch the application.
  11.         local
  12.             count : INTEGER
  13.             game: GAME
  14.             wi: INTEGER
  15.         do
  16.             from
  17.                 count := {GAME}.Min_player_count - 1
  18.             until
  19.                 {GAME}.Min_player_count <= count and count <= {GAME}.Max_player_count
  20.             loop
  21.                 print ("Enter number of players between " + {GAME}.Min_player_count.out + " and " + {GAME}.Max_player_count.out + ": ")
  22.                 io.read_integer
  23.                 count := io.last_integer
  24.             end
  25.  
  26.             create game.make (count)
  27.             game.play
  28.  
  29.             print ("%NAnd the winner(s) is/are:%N" + "%N")
  30.             from
  31.                 wi := 1
  32.             until
  33.                 wi > game.winners.count
  34.             loop
  35.                 if game.winners[wi] /= void then
  36.                     print ("    " + game.winners [wi].out + "%N")
  37.                 end
  38.                 wi := wi + 1
  39.             end
  40.             print ("%N**** GAME OVER! ****%N")
  41.  
  42.         end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement