Skip to content

Instantly share code, notes, and snippets.

View jasom's full-sized avatar

Jason Miller jasom

  • Santa Barbara, CA
View GitHub Profile
@jasom
jasom / day-5.lisp
Last active December 6, 2017 18:37 — forked from asimpson/day-5.lisp
Let as outtermost form of a DO body is a code-smell (this also gives a ~15% speedup)
(defun process(cells)
(do ((moves 0 (+ 1 moves))
(position 0)
(cell-value (elt cells 0) (ignore-errors (elt cells position))))
((null cell-value) (print moves))
(psetf
position (+ cell-value position)
(elt cells position) (1+ cell-value))))
(defun start()