Created
November 5, 2012 01:38
-
-
Save dyoo/4014787 to your computer and use it in GitHub Desktop.
right triangle example from jdc
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
#lang racket | |
(for*/list ([x (in-range 11)] | |
[y (in-range 11)] | |
[z (in-range 11)] | |
#:when (and (= (+ (* x x) (* y y)) (* z z)) (= (+ x y z) 24))) | |
(list x y z)) | |
(for*/list ([x (in-range 11)] | |
[y (in-range 11)] | |
#:when (= 24 (+ x y (sqrt (+ (* x x) (* y y)))))) | |
(list x y (sqrt (+ (* x x) (* y y))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment