Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,13 @@
(and
(println "--police-- --sanitation-- --fire--")
(dolist (lst
(filter
(fn(l) (and (= (unique l) l)
(= 12 (apply + l))
(member (l 0) '(2 4 6))
(= 2 (length (intersect (rest l)
'(1 2 3 4 5 6 7))))))
(map (fn(n) (map int (explode (string n))))
(sequence 111 777))))
(println (format " %d %d %d"
lst))))

View file

@ -0,0 +1 @@
(let (x 8) (list 'foo (pow 2 x) 'bar))

View file

@ -0,0 +1 @@
(=>> 8 (pow 2 ??) (list 'foo ?? 'bar))

View file

@ -0,0 +1,22 @@
(define-macro (=>> _E_ _form_)
(eval
(if $args
(cons '=>> (cons (list '=>> _E_ _form_) (args)))
(begin
(if (ref '?? _form_) (setf (nth $it _form_) _E_))
_form_))))
(=>>
(begin
(println "--police-- --sanitation-- --fire--")
(sequence 111 777))
(map (fn(n) (map int (explode (string n)))) ??)
(filter
(fn(L) (and (= (unique L) L)
(= 12 (apply + L))
(even? (L 0))
(empty? (difference L '(1 2 3 4 5 6 7)))))
??)
(dolist (lst ??)
(println (format " %d %d %d"
lst))))

View file

@ -0,0 +1,6 @@
(let (nums '(1 2 3 4 5 6 7))
(for (police 2 (last nums) 2)
(dolist (sanitation (difference nums (list police)))
(let (fire (- 12 sanitation police))
(if (member fire (difference nums (list sanitation police)))
(println police '- sanitation '- fire))))))

View file

@ -0,0 +1,8 @@
begin
Writeln('Police Fire Sanitation');
for var p := 2 to 6 step 2 do
for var f := 1 to 7 do
for var s := 1 to 7 do
if (p <> f) and (f <> s) and (p <> s) and (p + f + s = 12) then
Writeln($'{p,-8}{f,-8}{s,-8}');
end.