Langtons Ant by kozima

(defun f(p q a x y)(#0=dotimes(i(read)(#0#(x 70)(if(find t #2=(nth x a))(#0#(y 45(terpri))(format(#0#(x 70)(if #1=(nth y #2#)(return t)))"~:[ ~;#~]"#1#)))))(if #1#(psetf p(- q)q p)(psetf p q q(- p)))(setf #1#(not #1#)x(+ x p)y(+ y q))))(f 0 -1(loop repeat 70 collect(make-list 45))30 22)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page