--nextPart1683663.D7JR0Hymbj
Content-Type: text/plain;
charset tf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
i see.. it wasn't clear at first what the kind of data is that is the input
for the program.
However, after testing my little suggestion, i found that there are is a bug
in it - it didn't strip the \n from the line it gets. also i made the
iteration independent from the size of the board and made the output each
line a bit prettier ^^
def make_board
puts "Push enter, then begin input."
puts "(For Input Format Compilance, extra enter key is necessary)"
gets
board = Array.new(9){[]}
9.times do |i|
instr = gets.strip
board[i] = instr.split(//).map{|c| c.to_i}
puts board[i].inspect
end
return board
end
Am Samstag, 10. Dezember 2005 18:56 schrieb StarLion <hmrhouse / hotmail.com>
<hmrhouse@hotmail.:
> > 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.).
>
> Obviously i meant 9 strings of 9 characters.
--nextPart1683663.D7JR0Hymbj
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQBDmxjvMdQeL6eBxhIRAoYgAJ43n1oksn03Yjlg5y5ZXdp1hR293QCcC5q/
PMLVy09NJ2zPErgQ6GEs4Z8 be
-----END PGP SIGNATURE-----
--nextPart1683663.D7JR0Hymbj--