% ECLiPSe % http://eclipse.crosscoreop.com/eclipse/examples/nono.ecl.txt % Problem n2 ( http://www.pro.or.jp/~fuji/java/puzzle/nonogram/index-eng.html ) % % fztini 4.5 seconds % fz: with int_search on row_start_pos ++ col_start_pos: the solution comes after % 3 seconds and then 7 minutes for verifying that it is the only solution. % with int_search on row_start_pos ++ col_start_pos and -solutions 1: 4 sec! % lazy: 1.5 sec %% ROW RULES row_max = 10; row_states = array2d(1..row_total_states, 1..2, [ % pattern 0,0,0,1, % 1,2, 2,0, % pattern 0,0,0,3, % 1,2, 0,3, 0,4, 4,0, % pattern 0,0,1,3, % 1,2, 3,0, 3,4, 0,5, 0,6, 6,0, % pattern 0,0,2,4, % 1,2, 0,3, 4,0, 4,5, 0,6, 0,7, 0,8, 8,0, % pattern 0,0,1,2, % 1,2, 3,0, 3,4, 0,5, 5,0, % pattern 0,2,1,1, % 1,2, 0,3, 4,0, 4,5, 6,0, 6,7, 7,0, % pattern 1,1,1,1, % 1,2, 3,0, 3,4, 5,0, 5,6, 7,0, 7,8, 8,0, % pattern 0,2,1,1, % 1,2, 0,3, 4,0, 4,5, 6,0, 6,7, 7,0, % pattern 0,0,2,2, % 1,2, 0,3, 4,0, 4,5, 0,6, 6,0, % pattern 0,0,0,5 % 1,2, 0,3, 0,4, 0,5, 0,6, 6,0, ]); row_max_state = 8; row_total_states = 59; row_num_patterns = 10; row_num_states = [2,4,6,8,5,7,8,7,6,6]; % this is also the final state row_start_where = [1,3,7,13,21,26,33,41,48,54]; % COL_RULES: col_max = 10; col_states = array2d(1..col_total_states, 1..2, [ % pattern 0,0,0,4, 1,2, 0,3, 0,4, 0,5, 5,0, % pattern 0,0,1,3, 1,2, 3,0, 3,4, 0,5, 0,6, 6,0, % pattern 0,0,2,3, 1,2, 0,3, 4,0, 4,5, 0,6, 0,7, 7,0, % pattern 0,0,1,2, 1,2, 3,0, 3,4, 0,5, 5,0, % pattern 0,0,2,2, 1,2, 0,3, 4,0, 4,5, 0,6, 6,0, % pattern 0,1,1,1, 1,2, 3,0, 3,4, 5,0, 5,6, 6,0, % pattern 1,1,1,1, 1,2, 3,0, 3,4, 5,0, 5,6, 7,0, 7,8, 8,0, % pattern 0,1,1,1, 1,2, 3,0, 3,4, 5,0, 5,6, 6,0, % pattern 0,0,1,2, 1,2, 3,0, 3,4, 0,5, 5,0, % pattern 0,0,0,5 1,2, 0,3, 0,4, 0,5, 0,6, 6,0, ]); col_num_patterns = 10; col_max_state = 8; col_total_states = 60; col_num_states = [5,6,7,5,6,6,8,6,5,6]; % this is also the final state col_start_where = [1,6,12,19,24,30,36,44,50,55];