I’ve created a sudoku puzzle creator / solver and need a bit of help with some CSS to style it.
Typically they are styled like this:
.
Some naming I’m us
Great solution Jukka. I used a combination of this and the following .erb code to dynamically generate the table and pop the contents in.
@current_solution is my array holding the values for each cell.
<% 3.times do |all_box_rows_value|%>
<% 3.times do |box_row_value| %>
<% all_box_rows = all_box_rows_value * 27 %>
<% all_rows = ((box_row_value +1 ) * 9)-9 %>
<%9.times do |row| %>
<% index = all_box_rows+all_rows+row %>
<% value = @current_solution[index] %>
<% colour_class = get_colour_class index %>
>
<% end %>
<% end %>
<% end %>