From 31d4a69df836d59fecc165f4c8927fce9d3df78c Mon Sep 17 00:00:00 2001 From: sbosse Date: Tue, 27 Aug 2024 00:16:04 +0200 Subject: [PATCH] Tue 27 Aug 00:14:56 CEST 2024 --- test/test-csp.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/test-csp.js 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))