day 13 - part 2, now SORT with that ORDER
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user