Skip to content

Instantly share code, notes, and snippets.

@ayato-p
Created January 22, 2013 03:46
Show Gist options
  • Save ayato-p/4591889 to your computer and use it in GitHub Desktop.
Save ayato-p/4591889 to your computer and use it in GitHub Desktop.
(define (square x)
(* x x))
(define (func a b c)
(cond
((>= a 1000) -1)
((>= b 1000) (func (+ a 1) 1 1))
((>= c 1000) (func a (+ b 1) 1))
((and (= (+ a b c) 1000)
(= (+ (square a) (square b)) (square c)))
(* a b c))
(else
(func a b (+ c 1)))))
(func 1 1 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment