From: ashbb Date: 2013-07-01T21:58:05+09:00 Subject: Re: Help needed drawing a Sudoku board with green shoes --047d7b5d49ce69353f04e072c732 Content-Type: text/plain; charset=ISO-8859-1 Hi Ruby Student, I'm not sure this is the solution you are looking for. But try it out. ;-) require "green_shoes" require 'rubygems' Shoes.app :height => 666, :width => 811, :resizable => false do background magenta title (strong("Sudoku")), :size => 26, :align=>'center' para " " para " " @btn = Array.new(9) {Array.new(9) {123456789}} nostroke rect 0, 100, 86*9+6, 53*9+3, fill: green rect 86*3+3, 100, 86*3, 53*3+2, fill: yellow rect 0, 100+53*3+2, 86*3+3, 53*3, fill: yellow rect 86*6+3, 100+53*3+2, 86*3+2, 53*3, fill: yellow rect 86*3+3, 100+53*6+2, 86*3, 53*3+1, fill: yellow (0..8).each do |r| stack :margin => 3 do flow :width => 866 do (0..8).each do |c| @btn[r][c] = button "123456789", :width => 86, :height => 50 end # End do c end # flow end # End stack end # End do r end # app Regards, ashbb --047d7b5d49ce69353f04e072c732 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Ruby Student,

I'm not sure t= his is the solution you are looking for. But try it out. ;-)

require= "green_shoes"
require 'rubygems'

Shoes.app :he= ight =3D> 666, :width =3D> 811, :resizable =3D> false do
=A0=A0 background magenta
=A0=A0 title (strong("Sudoku")), :si= ze =3D> 26, :align=3D>'center'
=A0=A0=A0 para " "= ;
=A0=A0 para " "

=A0=A0 @btn =3D Array.new(9) {Array.n= ew(9) {123456789}}
=A0=A0
=A0=A0 nostroke
=A0=A0 rect 0, 100, 86*9+6, 53*9+3, fill: green
=A0= =A0 rect 86*3+3, 100, 86*3, 53*3+2, fill: yellow
=A0=A0 rect 0, 100+53*3= +2, 86*3+3, 53*3, fill: yellow
=A0=A0 rect 86*6+3, 100+53*3+2, 86*3+2, 5= 3*3, fill: yellow
=A0=A0 rect 86*3+3, 100+53*6+2, 86*3, 53*3+1, fill: yellow

=A0=A0 (0= ..8).each do |r|
=A0=A0=A0=A0=A0 stack :margin =3D> 3 do
=A0=A0=A0= =A0=A0=A0=A0=A0 flow :width =3D> 866 do
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 (0..8).each do |c|
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 @bt= n[r][c] =3D button "123456789", :width =3D> 86, :height =3D>= ; 50
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 end # End do c
=A0=A0=A0=A0=A0=A0=A0= =A0 end # flow
=A0=A0=A0=A0=A0 end # End stack
=A0=A0 end # End do r<= br>end # app

Regards,
ashbb
--047d7b5d49ce69353f04e072c732--