Advertisement
Guest User

Untitled

a guest
Sep 6th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. File.foreach(map) {|line|
  2. line = line.chomp
  3. @sizeofarray = line.size unless @sizeofarray
  4. @map_array = Array.new(@sizeofarray) {Array.new(@sizeofarray) {""}} unless @map_array
  5. line.each_char do |character|
  6. @map_array[rows][collumns] = character
  7. rows += 1
  8. end
  9. collumns += 1
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement