|
|
|
@ -46,7 +46,7 @@ |
|
|
|
#+begin_src emacs-lisp :results none |
|
|
|
#+begin_src emacs-lisp :results none |
|
|
|
(defun advent/dot (a b) |
|
|
|
(defun advent/dot (a b) |
|
|
|
"Return the dot product of the two vectors" |
|
|
|
"Return the dot product of the two vectors" |
|
|
|
(-reduce #'+ (-map (lambda (x) (* (car x) (cdr x))) (-zip-pair a b)))) |
|
|
|
(-sum (-map (lambda (x) (* (car x) (cdr x))) (-zip-pair a b)))) |
|
|
|
|
|
|
|
|
|
|
|
(defun advent/neighbour (p dir) |
|
|
|
(defun advent/neighbour (p dir) |
|
|
|
"Returns the neighbour to P in the direction DIR" |
|
|
|
"Returns the neighbour to P in the direction DIR" |
|
|
|
|