Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
8
Task/FizzBuzz/Scheme/fizzbuzz-1.ss
Normal file
8
Task/FizzBuzz/Scheme/fizzbuzz-1.ss
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(do ((i 1 (+ i 1)))
|
||||
((> i 100))
|
||||
(display
|
||||
(cond ((= 0 (modulo i 15)) "FizzBuzz")
|
||||
((= 0 (modulo i 3)) "Fizz")
|
||||
((= 0 (modulo i 5)) "Buzz")
|
||||
(else i)))
|
||||
(newline))
|
||||
10
Task/FizzBuzz/Scheme/fizzbuzz-2.ss
Normal file
10
Task/FizzBuzz/Scheme/fizzbuzz-2.ss
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(define (fizzbuzz x y)
|
||||
(println
|
||||
(cond (( = (modulo x 15) 0 ) "FizzBuzz")
|
||||
(( = (modulo x 3) 0 ) "Fizz")
|
||||
(( = (modulo x 5) 0 ) "Buzz")
|
||||
(else x)))
|
||||
|
||||
(if (< x y) (fizzbuzz (+ x 1) y)))
|
||||
|
||||
(fizzbuzz 1 100)
|
||||
9
Task/FizzBuzz/Scheme/fizzbuzz-3.ss
Normal file
9
Task/FizzBuzz/Scheme/fizzbuzz-3.ss
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(define (fizzbuzz x)
|
||||
(let ([words '((3 . "Fizz")
|
||||
(5 . "Buzz"))])
|
||||
(define (fbm x)
|
||||
(let ([w (map cdr (filter (lambda (wo) (= 0 (modulo x (car wo)))) words))])
|
||||
(if (null? w) x (apply string-append w))))
|
||||
(for-each (cut format #t "~a~%" <>) (map fbm (iota x 1 1)))))
|
||||
|
||||
(fizzbuzz 15)
|
||||
Loading…
Add table
Add a link
Reference in a new issue