Created
July 23, 2018 02:07
-
-
Save TonyMooori/e1d8c4dc19d89587f3aca15133b955ab to your computer and use it in GitHub Desktop.
アルゴリズムパズル 4 兵士の輸送
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 solve-4 (n-soldier n) | |
(if (= n-soldier 0) | |
(print (format nil "~{~A~}" (list "it takes " (write-to-string n) " steps."))) | |
(progn | |
(print "2 young man go to left.") | |
(print "1 young man go to right") | |
(print "1 soldier go to left.") | |
(print "1 young man go to right.") | |
(solve-4 (1- n-soldier) (+ 4 n))))) | |
(solve-4 25 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment