Created
June 20, 2015 23:59
-
-
Save zaltoprofen/9f2351c24f91d5d72217 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 (power s) | |
(define (power-rec a b) | |
(cond | |
((null? a) b) | |
(else (power-rec (cdr a) (append (map (lambda (x) (cons (car a) x)) b) b))))) | |
(map reverse (power-rec s '(())))) | |
(use srfi-27) | |
(random-source-randomize! default-random-source) | |
(define ps (power '(寝 る))) | |
(define r (filter (lambda (_) (> (random-real) 0.5)) ps)) | |
(display r)(display "\n") | |
(if (= 4 (length r)) | |
(display "寝る冪") | |
(display "寝る冪でない")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment