Skip to content

Instantly share code, notes, and snippets.

@triclops200
triclops200 / CollatzPrimeRatio.lisp
Last active December 21, 2015 00:58
Collatz Prime Ratio Visualizer
(defmacro while (test &body body)
`(do ()
((not ,test))
,@body))
(defmacro with-gensyms (syms &body body)
`(let ,(mapcar #'(lambda (x) `(,x (gensym))) syms)
,@body))
(defmacro collect-list (end-condition next-value var)
def swap_max(digits):
i = len(digits) - 1
while i > 0:
if digits[i] == 0:
i-= 1
else:
break
max_i = i
min_i = i
pot_i = i