fork download
  1. (defun fortunecookie ()
  2. (princ "名前または学籍番号を入力:")
  3. (let* ((id (read-line))
  4. (seed (reduce (lambda(a b)(+ a b)) (map 'list #'char-code id)))
  5. (date (write-to-string (/ (get-universal-time) 86400))) ; 日付を整数で取得
  6. (result (nth (mod seed 5)
  7. '("大吉! 挑戦を続けよう"
  8. "中吉! 今日は集中の日"
  9. "小吉! まずは一歩"
  10. "吉! 粘り勝ちを目指そう"
  11. "凶...でも明日がある! "))))
  12. (format t "結果:~A~%" result)))
  13. (fortunecookie)
Success #stdin #stdout 0.01s 29352KB
stdin
仁郎
stdout
名前または学籍番号を入力:結果:中吉! 今日は集中の日