/** This is a tester for Frink's "all different" constraint */ n = 4 if length[ARGS] > 0 // Parse command-line argument n = parseInt[ARGS@0] solver = newJava["frink.constraint.ConstraintSolver"] q = new array for i = 0 to n-1 q@i = solver.makeIntRangeVariable[0,n-1] solver.allDifferent[toVector[q]] listener = newJava["frink.constraint.PrintingSolutionListener"] //listener.setFirstOnly[true] // Comment this in to find only one solution. solver.solve[listener]