diff --git a/test/test-csp.js b/test/test-csp.js new file mode 100644 index 0000000..a9eb4a3 --- /dev/null +++ b/test/test-csp.js @@ -0,0 +1,12 @@ +var m = csp.solver(csp.CSP.SIMPLE) +csp.V(m,'x',csp.range(1,9)) +csp.V(m,'y',[1,2,3,4,5,6,7,8,9]) +csp.V(m,'z',[1,2,3,4,5,6,7,8,9]) +csp.C(m,'x','y',function (x,y) { return x > y }) +csp.C(m,'y','z',function (y,z) { return y > z }) +csp.C(m,'x','y',function (x,y) { return x > 3 && y < 7 }) +csp.C(m,'x','y',function (x,y) { return x != y }) +csp.C(m,'z',null,function (z) { return z > 2 }) +print(m) +print(toJSON(m).length+' Bytes') +print(csp.solve(m))