fork download
  1. (defun fortunecookie ()
  2. (princ "名前または学籍番号を入力:")
  3. (let* ((id (read-line))
  4. (now (multiple-value-list (decode-universal-time (get-universal-time))))
  5. (year (nth 5 now))
  6. (month (nth 4 now))
  7. (day (nth 3 now))
  8. ;; YYYYMMDD の文字列
  9. (date-str (format nil "~4,'0D~2,'0D~2,'0D" year month day))
  10. ;; ID + 日付をまとめたシード文字列
  11. (full-seed-str (concatenate 'string id date-str))
  12. (char-codes (map 'list #'char-code full-seed-str))
  13. (seed (reduce #'+ char-codes :initial-value 0))
  14. (fortunes '("大吉!挑戦を続けよう"
  15. "中吉!今日は集中の日"
  16. "小吉!まずは一歩"
  17. "吉!粘り勝ちを目指そう"
  18. "凶…でも明日がある!"))
  19. (result (nth (mod seed (length fortunes)) fortunes)))
  20. (format t "~%結果:~A~%" result)))
  21.  
Success #stdin #stdout #stderr 0.02s 9568KB
stdin
工藤嘉悦
stdout
Standard output is empty
stderr
Warning: reserving address range 0x80000c0000...0x1fffffffffff that contains memory mappings. clisp might crash later!
Memory dump:
  0x8000000000 - 0x80000bffff
  0x155017800000 - 0x155017ae4fff
  0x155017c00000 - 0x155017c02fff
  0x155017c03000 - 0x155017e01fff
  0x155017e02000 - 0x155017e02fff
  0x155017e03000 - 0x155017e03fff
  0x155017e15000 - 0x155017e39fff
  0x155017e3a000 - 0x155017facfff
  0x155017fad000 - 0x155017ff5fff
  0x155017ff6000 - 0x155017ff8fff
  0x155017ff9000 - 0x155017ffbfff
  0x155017ffc000 - 0x155017ffffff
  0x155018000000 - 0x155018003fff
  0x155018004000 - 0x155018203fff
  0x155018204000 - 0x155018204fff
  0x155018205000 - 0x155018205fff
  0x155018206000 - 0x155018207fff
  0x155018208000 - 0x155018217fff
  0x155018218000 - 0x15501824bfff
  0x15501824c000 - 0x155018382fff
  0x155018383000 - 0x155018383fff
  0x155018384000 - 0x155018386fff
  0x155018387000 - 0x155018387fff
  0x155018388000 - 0x155018389fff
  0x15501838a000 - 0x15501838afff
  0x15501838b000 - 0x15501838cfff
  0x15501838d000 - 0x15501838dfff
  0x15501838e000 - 0x15501838efff
  0x15501838f000 - 0x15501838ffff
  0x155018390000 - 0x15501839dfff
  0x15501839e000 - 0x1550183abfff
  0x1550183ac000 - 0x1550183b8fff
  0x1550183b9000 - 0x1550183bcfff
  0x1550183bd000 - 0x1550183bdfff
  0x1550183be000 - 0x1550183befff
  0x1550183bf000 - 0x1550183c4fff
  0x1550183c5000 - 0x1550183c6fff
  0x1550183c7000 - 0x1550183c7fff
  0x1550183c8000 - 0x1550183c8fff
  0x1550183c9000 - 0x1550183c9fff
  0x1550183ca000 - 0x1550183f7fff
  0x1550183f8000 - 0x155018406fff
  0x155018407000 - 0x1550184acfff
  0x1550184ad000 - 0x155018543fff
  0x155018544000 - 0x155018544fff
  0x155018545000 - 0x155018545fff
  0x155018546000 - 0x155018559fff
  0x15501855a000 - 0x155018581fff
  0x155018582000 - 0x15501858bfff
  0x15501858c000 - 0x15501858dfff
  0x15501858e000 - 0x155018593fff
  0x155018594000 - 0x155018596fff
  0x155018599000 - 0x155018599fff
  0x15501859a000 - 0x15501859afff
  0x15501859b000 - 0x15501859bfff
  0x15501859c000 - 0x15501859cfff
  0x15501859d000 - 0x15501859dfff
  0x15501859e000 - 0x1550185a4fff
  0x1550185a5000 - 0x1550185a7fff
  0x1550185a8000 - 0x1550185a8fff
  0x1550185a9000 - 0x1550185c9fff
  0x1550185ca000 - 0x1550185d1fff
  0x1550185d2000 - 0x1550185d2fff
  0x1550185d3000 - 0x1550185d3fff
  0x1550185d4000 - 0x1550185d4fff
  0x55f5eae27000 - 0x55f5eaf17fff
  0x55f5eaf18000 - 0x55f5eb021fff
  0x55f5eb022000 - 0x55f5eb081fff
  0x55f5eb083000 - 0x55f5eb0b1fff
  0x55f5eb0b2000 - 0x55f5eb0e2fff
  0x55f5eb0e3000 - 0x55f5eb0e6fff
  0x55f5ebcdb000 - 0x55f5ebcfbfff
  0x7fffaf13a000 - 0x7fffaf15afff
  0x7fffaf1c8000 - 0x7fffaf1cbfff
  0x7fffaf1cc000 - 0x7fffaf1cdfff