From: Joop Van den tillaart Date: 2007-06-21T21:35:00+09:00 Subject: Re: Help needed with my grid and code So i adjusted some of my code and now it is a little bit better...the last part of the code is now: grid.height.times do |y| grid.width.times do |x| if grid[x, y].distance_road print grid[x, y].type print grid[x, y].distance_road else print grid[x, y].type print grid[x, y].distance_road end end print "\n" end and generates: 0nil0nil0nil0nil0nil011101020304050111 0nil0nil0nil0nil02011101020304020111 0nil0nil0nil0302011101020303020111 0nil0nil040302011101020303020111 0nil05040302011101020303020111 0101010101011101010101010111 1111111111111111111111111111 0202020202011101020202020111 0303030302011101020303020111 0404040302011101020303020111 0505040302011101020303020111 0605040302011101020303020111 0605040302011101020303020111 0605040302011102020303020111 Anyone has any pointers what im doing wrong? Thanks! -- Posted via http://www.ruby-forum.com/.