Hello Ruby/Shoes World!
As part of my Ruby learning experience I started looking into a GUI
environment.
Shoes appears to be simple enough that I would probably be able to learn
it.
I am working on a simple Sudoku solver in Ruby, as a Ruby learning
exercise.
To this point I have been using stray ASCII output, but I would like to
beautify it using GUI.
To that effect, I was looking at some of the Shoes sample programs,
specifically the one named calc.
I selected calc because it shows how to place several buttons on a row.
Although the buttons on calc represents the basic symbols of a
calculator, I
thought copying the same concept to represents the 9x9 matrix of a
“regular”
sudoku puzzle.
The following is the modified code from calc to display the board, and
for
which I have some questions:
Shoes.app(:title => " A Humble
Sudoku Solver “, :height => 546, :width => 617, :resizable => false) do
background “#EEC”…”#996", :radius => 5, :top => 2, :left => 2,
:width
=> -4, :height => -4
stack :margin => 0 do
stack :margin => 0
btn = “123456789”
flow :width => 618, :margin => 4 do
(1…81).each do |n|
button btn, :width => 66, :height => 66
end
end
end
end
-
- For the title, is there some formatting to tell Shoes to center or
left/right justified a title?
- For the title, is there some formatting to tell Shoes to center or
-
- For the background I tried fill green right after the last "
(double
quote) but it gave me an error. How could I specified fill green,
although I
don’t really need it.
- For the background I tried fill green right after the last "
-
- What purpose of :radius => 5?
-
- If you are familiar with sudoku, how do you add solid lines to
separate
each subgroup of 3x3?
- If you are familiar with sudoku, how do you add solid lines to
Although I have many more questions, I will continue looking the
documentation, including nks.
Thank you
Ruby S.