Advertisement
Guest User

Day 19

a guest
Dec 17th, 2017
111
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defparameter *stepdist* 367)
  2. (defparameter *buf* '(0))
  3. (rplacd *buf* *buf*)
  4.  
  5. (defun insert! (l s n)
  6.   (let ((c (nthcdr s l)))
  7.     (rplacd c (cons n (cdr c)))
  8.     (cdr c)))
  9.  
  10. (defun fill! (l s lim)
  11.   (loop for i from 1 to lim
  12.      do (setf l (insert! l s i)))
  13.   l)
  14.  
  15. (defun find-after (l n)
  16.   (if (eq (car l) n)
  17.       (cadr l)
  18.       (find-after (cdr l) n)))
  19. (format t "~a~%" (cadr (fill! *buf* *stepdist* 2017)))
  20. (setf *buf* '(0))
  21. (rplacd *buf* *buf*)
  22. (format t "~a~%" (find-after (fill! *buf* *stepdist* 50000000) 0))
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement