You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
572 B
15 lines
572 B
2 years ago
|
#!/run/current-system/profile/bin/env gxi-script
|
||
|
(define multiple-of-3-or-5
|
||
|
(lambda (x) (case
|
||
|
(or (= 0 (modulo x 3)) (= 0 (modulo x 5)))
|
||
|
((#t) #t)
|
||
|
((#f) #f))))
|
||
|
|
||
|
(define countdown (lambda (x) (if (> x 0)
|
||
|
((lambda ()
|
||
|
(if (multiple-of-3-or-5 x)
|
||
|
(println x)))))
|
||
|
(if (not (eqv? 2 (- -1 x)))
|
||
|
(countdown (- x 1)))))
|
||
|
(countdown 1000)
|