Skip to content

Instantly share code, notes, and snippets.

@jeremiahbiard
Last active July 28, 2017 12:43
Show Gist options
  • Save jeremiahbiard/c33d408cefa599907b27256757b40c63 to your computer and use it in GitHub Desktop.
Save jeremiahbiard/c33d408cefa599907b27256757b40c63 to your computer and use it in GitHub Desktop.
(defun comp (a b)
(cond ((< a b) 'bob)
((> a b) 'alice)))
(defvar a (with-input-from-string (in (read-line))
(loop for x = (read in nil nil) while x collect x)))
(defvar b (with-input-from-string (in (read-line))
(loop for x = (read in nil nil) while x collect x)))
(defvar r (mapcar #'comp a b))
(defvar alice 0)
(defvar bob 0)
(mapcar #'(lambda (x)
(cond ((equal x 'alice) (incf alice))
((equal x 'bob) (incf bob)))
) r)
(format t "~S ~S" alice bob)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment