Skip to content

Instantly share code, notes, and snippets.

@10nin
Created July 11, 2018 12:28
Show Gist options
  • Save 10nin/5e250f31508545eb6e6ddc55fd2cec6e to your computer and use it in GitHub Desktop.
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.
(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