Almost about to give up on this

main
Jacopo De Simoi 11 months ago
parent 5a37b49104
commit c2632418ba
  1. 15
      p16/p16.org

@ -77,6 +77,11 @@ associated scores;
For debugging, print the map
#+begin_src emacs-lisp
(setq dir-alist '( ((1 0) . ?→)
((-1 0). ?←)
((0 -1). ?↑)
((0 1) . ?↓)))
(defun plot (p s)
(goto-line (+ (cadr p) 1))
(move-to-column (car p))
@ -86,11 +91,11 @@ For debugging, print the map
(defun print-map (&optional p)
(with-temp-buffer
(-each data (lambda (x) (insert x) (insert "\n")))
(insert (format "min-score: %d" (caddr (car start-list))))
(-each book (lambda (x) (plot x ?X)))
(-each start-list (lambda (x) (plot (car x) (cdr (assoc (cadr x) dir-alist)))))
(when p (plot p ?@))
(write-file "tmp")) )
#+end_src
#+RESULTS:
@ -134,14 +139,10 @@ we stop at each turn
(setq start-list (list start-vector))
(while (setq start-list (-concat (explore (car start-list)) (cdr start-list)))
(setq start-list (-sort #'sort-vecs start-list))
)
(print-map)
scores
(setq start-list (-sort #'sort-vecs start-list)))
#+end_src
#+results:
| 81448 | 72432 |
#+RESULTS:
| 81448 | 72432 |

Loading…
Cancel
Save