Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
var Baker, Cooper, Fletcher, Miller, Smith; // value == floor
|
||||
const bottom=1,top=5; // floors: 1..5
|
||||
// All live on different floors, enforced by using permutations of floors
|
||||
//fcn c0{ (Baker!=Cooper!=Fletcher) and (Fletcher!=Miller!=Smith) }
|
||||
fcn c1{ Baker!=top }
|
||||
fcn c2{ Cooper!=bottom }
|
||||
fcn c3{ bottom!=Fletcher!=top }
|
||||
fcn c4{ Miller>Cooper }
|
||||
fcn c5{ (Fletcher - Smith).abs() !=1 }
|
||||
fcn c6{ (Fletcher - Cooper).abs()!=1 }
|
||||
|
||||
filters:=T(c1,c2,c3,c4,c5,c6);
|
||||
dudes:=T("Baker","Cooper","Fletcher","Miller","Smith"); // for reflection
|
||||
foreach combo in (Utils.Helpers.permuteW([bottom..top].walk())){ // lazy
|
||||
dudes.zip(combo).apply2(fcn(nameValue){ setVar(nameValue.xplode()) });
|
||||
if(not filters.runNFilter(False)){ // all constraints are True
|
||||
vars.println(); // use reflection to print solution
|
||||
break;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue