Created
August 23, 2018 12:14
-
-
Save theodesp/cbbcf2aac934763a652bc40a0344e8e6 to your computer and use it in GitHub Desktop.
Is Leap year #scheme
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
(import (rnrs (6))) | |
(use-modules ((rnrs) :version (6))) | |
(define (leap-year? year) | |
(if (and (divisible? year 4) (not (divisible? year 100))) | |
#t | |
(if (divisible? year 400) | |
#t | |
#f))) |
I think you only need to provide the divisible?
function
(define (divisible? n x)
(zero? (remainder n x)))
and skip the imports in the beginning. I think they only work for guile scheme
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there. I am actually having some difficulties on how to execute the program. How do i give input to the function ?