Data Update

This commit is contained in:
Ingy döt Net 2023-07-18 13:51:12 -07:00
parent e50b5c3114
commit 633b36288a
206 changed files with 4762 additions and 965 deletions

View file

@ -0,0 +1,18 @@
use itertools::Itertools;
fn main() {
for p in (1..6).permutations(5) {
let baker: i32 = p[0];
let cooper: i32 = p[1];
let fletcher: i32 = p[2];
let miller: i32 = p[3];
let smith: i32 = p[4];
if baker != 5 && cooper != 1 && fletcher != 1 && fletcher != 5 && cooper < miller &&
(smith - fletcher).abs() > 1 && (cooper - fletcher).abs() > 1 {
print!("Baker on {baker}, Cooper on {cooper}, ");
println!("Fletcher on {fletcher}, Miller on {miller}, Smith on {smith}.");
break;
}
}
}

View file

@ -9,7 +9,7 @@ func dinesman(problem) {
var re_keywords = Regex(words.join('|'))
 
# Build an array of lambda's
var predicates = lines.ft(1, lines.end-1).map{ |line|
var predicates = lines.first(-1).last(-1).map{ |line|
var keywords = line.scan(re_keywords)
var (name1, name2) = line.scan(re_names)...