From: "StarLion " Date: 2005-12-11T02:55:44+09:00 Subject: Re: Logic... m.fellinger wrote: > Ok, i made a bit more cleaned up version, but i'm still not sure what > you want > to do with your method. > especially, what does this .to_i mean? > > However, for everything you write twice or more often, ruby usually has > a way > to make it at the same time cleaner and easier to write. > > > def make_board > puts "Push enter, then begin input." > puts "(For Input Format Compilance, extra enter key is necessary)" > gets > board = Array.new(9){[]} > board.size.times do |i| > instr = gets > board[i] = instr.split(//).map{|c| c.to_i} > puts board[i] > end > return board > end > > Am Samstag, 10. Dezember 2005 18:25 schrieb StarLion: The idea is to take a string of 9 characters, and transform them into an array of integers, which are stored in an array of rows (IE: generate a 9x9 array.). -- Posted via http://www.ruby-forum.com/.