day 13 - part 2, now SORT with that ORDER

This commit is contained in:
efim
2022-12-14 20:41:44 +00:00
parent 1457992342
commit 16cb2be49b
4 changed files with 30 additions and 0 deletions

View File

@@ -161,3 +161,19 @@
(nest-2-< '(2)
'((2) 7)) ; here it is...
;;; PART 2
;; now working with the whole list - i need to sort it with that function
(let ((sorted (sort (copy-list *day13-all-list*) (lambda (left right)
(< (nest-2-< left right) 0)))))
(* (1+ (position '((2)) sorted :test #'equal))
(1+ (position '((6)) sorted :test #'equal))))
(sort '(5 1 432 2 14) #'>)
(sort '(5 1 432 2 14) #'<)
(< 1 2)
(find '(1 2) '(1 (1 3) (1 2)) :test #'equal)
(position '(1 2) '(1 (1 3) (1 2)) :test #'equal)