Created
August 17, 2012 20:51
-
-
Save captainsafia/3382528 to your computer and use it in GitHub Desktop.
Solution to Project Euler Problem 1 in Scheme
This file contains 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 sum 0) | |
(define (3or5 start limit inc) | |
(if (< start limit) | |
(begin | |
(if (= (remainder start 3) 0) (set! sum (+ sum start)) (if (= (remainder start 5) 0) (set! sum (+ sum start)))) | |
(3or5 (+ start inc) limit inc))) sum) | |
(print (3or5 0 1000 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment