ããã°ãã¯ã第äºåè lispã®æéã§ãã ä»åã¯ã«ã¼ãå¦çã¨é«éé¢æ°ã«ã¤ãã¦èª¬æãã¾ããããã¦æå¾ã«fizzbuzzåé¡ã®ã¢ã¬ã³ã¸çãä½ã£ã¦ã¿ã¾ããã ã«ã¼ã ä¸çªåç´ãªã«ã¼ãã¯whileã§ããæ¸ãæ¹ã¯ãã¡ãã (while æ¡ä»¶å¼ ãã©ã¼ã 1 ãã©ã¼ã 2 ) whileã使ã£ã¦ã1ããlimitã¾ã§ã®ãªã¹ããä½ãé¢æ°ãä½ã£ã¦ã¿ã¾ãã fizzbuzzãªã®ã§1ãã15ã¾ã§ã®ãªã¹ããä½ãã¾ãã (defun generate-list (limit) (let ((i 1) ret) (while (<= i limit) (setq ret (cons i ret)) (setq i (1+ i))) (reverse ret))) (generate-list 15) ; (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) é«éé¢æ° é«éé¢æ°ã¨ããã®ã¯å¼æ°ã«é¢æ°ã
{{#tags}}- {{label}}
{{/tags}}