Created
July 11, 2018 12:28
-
-
Save 10nin/5e250f31508545eb6e6ddc55fd2cec6e to your computer and use it in GitHub Desktop.
scheme script for (mytimes 5 'foo) → (foo foo foo foo foo) I want more good solution.
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
(define (mytimes n val) | |
(if (= n 1) (list val) | |
(append (list val) (mytimes (- n 1) val)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment