Tue 27 Aug 00:14:56 CEST 2024
This commit is contained in:
		
							parent
							
								
									194ba79223
								
							
						
					
					
						commit
						31d4a69df8
					
				
							
								
								
									
										12
									
								
								test/test-csp.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								test/test-csp.js
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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))
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user