Advertisement
PhilDrummer

Assignment_2 01

Sep 26th, 2014
2,695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 0.86 KB | None | 0 0
  1. note
  2.     description: "Introduction to Traffic."
  3.  
  4. class
  5.     PREVIEW
  6.  
  7. inherit
  8.     ZURICH_OBJECTS
  9.  
  10. feature -- Explore Zurich
  11.  
  12.     explore
  13.             -- Modify the map.
  14.     local -- Initializing a variable to keep count of the loops passed (used later)
  15.         count : INTEGER
  16.  
  17.         do
  18.             Zurich.add_station ("Zoo", 1800, -500) -- Adding the station "Zoo"
  19.             Zurich.connect_station (6, "Zoo") -- Adding "Zoo" to line 6
  20.             Zurich_map.update -- Updating the map
  21.             Zurich_map.fit_to_window -- Scaling the map
  22.  
  23.             from count := 1 -- Creating a loop tha will let "Zoo" blink 10 times.
  24.             until count = 10
  25.             loop
  26.                 wait (1)
  27.                 Zurich_map.station_view (Zurich.station ("Zoo")).highlight
  28.                 wait (1)
  29.                 Zurich_map.station_view (Zurich.station ("Zoo")).unhighlight
  30.                 count := count + 1 -- Incrementing the "count" variable by one (Loop has been completed + 1 time)
  31.             end
  32.  
  33.         end
  34.  
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement