Matthew Butterick 9 years ago
parent b5de86f326
commit 0161382878

@ -45,11 +45,11 @@
;; FunctionConstraint, two ways: implicit and explicit
(send problem reset)
(send problem add-variables '(a b) '(1 2))
(send problem add-constraint >) ; implicit
(send problem add-constraint <) ; implicit
(check-hash-items (send problem get-solution) #hash((a . 1) (b . 2)))
(send problem reset)
(send problem add-variables '(a b) '(1 2))
(send problem add-constraint (new function-constraint% [func >])) ; explicit
(send problem add-constraint (new function-constraint% [func <])) ; explicit
(check-hash-items (send problem get-solution) #hash((a . 1) (b . 2)))
;; AllDifferentConstraint

Loading…
Cancel
Save