Last active
October 18, 2018 17:52
-
-
Save eriksvedang/5b53123d1f00960d4eb4eee1f93a5399 to your computer and use it in GitHub Desktop.
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
| (defn gcd [a b] | |
| (let [r (mod a b) | |
| q (Int./ a b)] | |
| (if (= r 0) | |
| b | |
| (gcd b r)))) | |
| (defn gen [] | |
| (let [a (Int.random-between 0 99) | |
| b (Int.random-between 0 99) | |
| d (gcd a b)] | |
| (str* a "x + " b "y = " d))) | |
| (defn-do main [] | |
| (Random.seed (Double.from-int (System.time))) | |
| (ignore (Int.random-between 0 99)) | |
| (println* (gen))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment