Created
May 28, 2016 14:15
-
-
Save t-sin/319ff256dc1e462cd46b6d0833579778 to your computer and use it in GitHub Desktop.
ズン・ズンズンズンドコ \キ・ヨ・シ/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun zundoko () | |
(let ((zundoko '(ズン ドコ)) | |
(zundoko-state 0)) | |
(labels ((randoko () | |
(nth (random 2) zundoko)) | |
(zundoko-reset () (setf zundoko-state 0)) | |
(zundoko-next () (incf zundoko-state)) | |
(zundoko-check (s zd true-ret true-fn) | |
(if (eq (find s zundoko) zd) | |
(prog1 true-ret (funcall true-fn)) | |
(prog1 nil (zundoko-reset)))) | |
(kiyoshi-p (s) | |
(if (and (<= 0 zundoko-state) | |
(> 4 zundoko-state)) | |
(zundoko-check s 'ズン nil #'zundoko-next) | |
(zundoko-check s 'ドコ t #'zundoko-reset)))) | |
(loop | |
:for s := (print (randoko)) | |
:until (kiyoshi-p s) | |
:finally (print 'キ・ヨ・シ))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment