Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. note
  2. description: "GAME2016GULMAN_RETURN application root class"
  3. date: "$Date$"
  4. revision: "$Revision$"
  5.  
  6. class
  7. APPLICATION
  8.  
  9. inherit
  10. ARGUMENTS
  11.  
  12. create
  13. make
  14.  
  15.  
  16. feature{NONE} -- READING`N`CHECKING_INPUT
  17.  
  18. size_reading
  19. do
  20. io.put_string ("Input a number of columns")
  21. io.read_integer
  22. columns := io.last_integer
  23. if(columns > 50) --unexpectable
  24. then
  25.  
  26. io.put_string ("Your number of columns is too big")
  27. size_reading
  28. else
  29. io.put_string ("Input a numer of rows")
  30. io.read_integer
  31. rows := io.last_integer
  32. if(rows > 30) then
  33. io.put_string ("Your number of rows is too big")
  34. size_reading
  35. end
  36. end
  37. end
  38.  
  39. reading(in_str:INTEGER is_filled: BOOLEAN):INTEGER
  40. do
  41. if(in_str > 0 and columns - in_str > 0) then
  42. Result := in_str
  43. end
  44.  
  45. end
  46. rows: INTEGER
  47. columns: INTEGER
  48. inpt: INTEGER
  49. i: INTEGER
  50. player: INTEGER
  51. m: ARRAY2[INTEGER]
  52.  
  53. feature {NONE} -- Initialization
  54.  
  55. make
  56. -- Run application.
  57. do
  58. size_reading
  59. from
  60.  
  61. until
  62. false
  63. loop
  64. io.read_integer
  65. inpt := reading(io.last_integer, false)
  66. m[inpt, columns] := player
  67. io.put_integer_64 (inpt)
  68.  
  69. end
  70.  
  71.  
  72. end
  73.  
  74.  
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement