Created
February 7, 2017 04:34
-
-
Save tuturto/5c9d8fa6e01f0fd37d91deb5548bc5c4 to your computer and use it in GitHub Desktop.
on page 34 of Evidence-Based programming language design
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
x <- rand(25); | |
y <- rand(25); | |
comment set x and y to random integers in [1, 25]; | |
write What is <(x)> + <(y)>; | |
[accept reply; if reply | |
| = x+y : write Very good; correct_count <- correct_count + 1; | |
| = x*y : write Add, don’t multiply; again; | |
| > x+y+10 : write No, that’s more than 10 too much; again; | |
| else : write No, try again; again; | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A rough attempt in Hy.
I'm mostly doing this to try to understand how exactly KAIL is supposed to work. I noticed that my version repeats
reply
, but the original doesn't.