%% Nonogram problem from Gecode: Bear %% http://www.gecode.org/gecode-doc-latest/classNonogram.html %% %% ROW RULES row_max = 8; row_states = array2d(1..row_total_states, 1..2, [ % pattern 0,1, % tmp: dummy 0 1 % 1,2, 2,0, % pattern 0,2, % tmp: dummy 0 1 1 % 1,2, 0,3, 3,0, % pattern 4,4, % tmp: dummy 0 1 1 1 1 0 1 1 1 1 % 1,2, 0,3, 0,4, 0,5, 6,0, 6,7, 0,8, 0,9, 0,10, 10,0, % pattern 0,12, % tmp: dummy 0 1 1 1 1 1 1 1 1 1 1 1 1 % 1,2, 0,3, 0,4, 0,5, 0,6, 0,7, 0,8, 0,9, 0,10, 0,11, 0,12, 0,13, 13,0, % pattern 0,8, % tmp: dummy 0 1 1 1 1 1 1 1 1 % 1,2, 0,3, 0,4, 0,5, 0,6, 0,7, 0,8, 0,9, 9,0, % pattern 0,9, % tmp: dummy 0 1 1 1 1 1 1 1 1 1 % 1,2, 0,3, 0,4, 0,5, 0,6, 0,7, 0,8, 0,9, 0,10, 10,0, % pattern 3,4, % tmp: dummy 0 1 1 1 0 1 1 1 1 % 1,2, 0,3, 0,4, 5,0, 5,6, 0,7, 0,8, 0,9, 9,0, % pattern 2,2 % tmp: dummy 0 1 1 0 1 1 % 1,2, 0,3, 4,0, 4,5, 0,6, 6,0, ]); row_max_state = 13; row_total_states = 62; row_num_patterns = 8; row_num_states = [2,3,10,13,9,10,9,6]; % this is also the final state row_start_where = [1,3,6,16,29,38,48,57]; % COL_RULES: col_max = 13; col_states = array2d(1..col_total_states, 1..2, [ % pattern 0,2, % tmp: dummy 0 1 1 1,2, 0,3, 3,0, % pattern 2,1, % tmp: dummy 0 1 1 0 1 1,2, 0,3, 4,0, 4,5, 5,0, % pattern 3,2, % tmp: dummy 0 1 1 1 0 1 1 1,2, 0,3, 0,4, 5,0, 5,6, 0,7, 7,0, % pattern 0,6, % tmp: dummy 0 1 1 1 1 1 1 1,2, 0,3, 0,4, 0,5, 0,6, 0,7, 7,0, % pattern 1,4, % tmp: dummy 0 1 0 1 1 1 1 1,2, 3,0, 3,4, 0,5, 0,6, 0,7, 7,0, % pattern 0,3, % tmp: dummy 0 1 1 1 1,2, 0,3, 0,4, 4,0, % pattern 0,4, % tmp: dummy 0 1 1 1 1 1,2, 0,3, 0,4, 0,5, 5,0, % pattern 0,4, % tmp: dummy 0 1 1 1 1 1,2, 0,3, 0,4, 0,5, 5,0, % pattern 0,4, % tmp: dummy 0 1 1 1 1 1,2, 0,3, 0,4, 0,5, 5,0, % pattern 0,5, % tmp: dummy 0 1 1 1 1 1 1,2, 0,3, 0,4, 0,5, 0,6, 6,0, % pattern 0,4, % tmp: dummy 0 1 1 1 1 1,2, 0,3, 0,4, 0,5, 5,0, % pattern 1,3, % tmp: dummy 0 1 0 1 1 1 1,2, 3,0, 3,4, 0,5, 0,6, 6,0, % pattern 0,2 % tmp: dummy 0 1 1 1,2, 0,3, 3,0, ]); col_num_patterns = 13; col_max_state = 7; col_total_states = 68; col_num_states = [3,5,7,7,7,4,5,5,5,6,5,6,3]; % this is also the final state col_start_where = [1,4,9,16,23,30,34,39,44,49,55,60,66];