Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 0.92 KB | None | 0 0
  1.  
  2.         from k:=1
  3.         until k>i
  4.         loop
  5.             from j:=1
  6.             until j>i
  7.             loop
  8.                 print (arr.item (k, j)) print (" ")
  9.                 j:=j+1
  10.             end
  11.             k:=k+1
  12.             print("%N")
  13.         end
  14.  
  15.         from k:=i
  16.         until k<1
  17.         loop
  18.             from j:=k
  19.             until j<i-k+2
  20.             loop
  21.                 if (arr.item(i-j+1, k)/~'#') then
  22.                     str1.append_character(arr.item (i-j+1, k))
  23.                 end
  24.                 j:=j-1
  25.             end
  26.  
  27.             from j:=k
  28.             until j<i-k+2
  29.             loop
  30.                 if (arr.item(k, j)/~'#') then
  31.                     str1.append_character(arr.item (k, j))
  32.                 end
  33.                 j:=j-1
  34.             end
  35.  
  36.             from j:=k
  37.             until j<i-k+2
  38.             loop
  39.                 if (arr.item(j , i-k+1)/~'#') then
  40.                     str1.append_character(arr.item (j, i-k+1))
  41.                 end
  42.                 j:=j-1
  43.             end
  44.  
  45.             from j:=k
  46.             until j<i-k+2
  47.             loop
  48.                 if (arr.item(i-k+1, i-j+1)/~'#') then
  49.                     str1.append_character(arr.item (i-k+1, i-j+1))
  50.                 end
  51.                 j:=j-1
  52.             end
  53.             k:=k-1
  54.         end
  55.  
  56.         str1.append_character (arr.item (i//2+1, i//2+1))
  57.  
  58.         Result := str1
  59.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement