Skip to content

Instantly share code, notes, and snippets.

@pocket7878
Created September 14, 2013 12:36
Show Gist options
  • Save pocket7878/6561697 to your computer and use it in GitHub Desktop.
Save pocket7878/6561697 to your computer and use it in GitHub Desktop.
Shibuya.Lisp Meetup8のライブコーディングを僕もやってみた。
(load "~/quicklisp/setup.lisp")
(let* ((*standard-output* (make-broadcast-stream))
(*error-output* *standard-output*))
(ql:quickload :split-sequence))
(defun parse-ls-l ()
;;Throught first line
(read-line)
(loop for line = (read-line t nil nil)
while line
for words = (remove ""
(split-sequence:split-sequence #\Space line))
for sec = (parse-integer (nth 1 words))
for fiv = (parse-integer (nth 4 words))
if (zerop (mod sec 2))
sum fiv into even
else
sum fiv into odd
finally (return (values even odd))))
(multiple-value-bind (e o) (parse-ls-l)
(format t "Even: ~A~% Odd: ~A~%" e o))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment