Skip to content

Instantly share code, notes, and snippets.

View kim0's full-sized avatar

Ahmed Kamal kim0

  • http://cloud9ers.com/
  • Cairo, Egypt
View GitHub Profile
% include "globals.mzn";
int: n = 3;
int: num_moves = 3; % first row is the init move
array[0..num_moves,1..n] of var bool: x;
array[1..n] of bool: init = [true,false,true]; % Initial state
array[1..num_moves] of var 1..num_moves: ops_seq; % The sequence of flips to solution
array[1..n,1..n] of bool: operations = [|false, false, true | false, true, false| true, false, false|]; % true means flip bit
% Constraints