diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-10-26 23:57:25 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-10-26 23:57:25 -0700 |
commit | 20cca772b85661b607af760d0b77ef603b5ce222 (patch) | |
tree | 1ae6e2a78b3979d7d24a0875a9dd10779a8e852f /tutorial/task11.mu | |
parent | a3f73278b198d0366c590ec8bd7fb8cad5c2931d (diff) | |
download | mu-20cca772b85661b607af760d0b77ef603b5ce222.tar.gz |
task: conditional execution
Diffstat (limited to 'tutorial/task11.mu')
-rw-r--r-- | tutorial/task11.mu | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tutorial/task11.mu b/tutorial/task11.mu new file mode 100644 index 00000000..0b9796e7 --- /dev/null +++ b/tutorial/task11.mu @@ -0,0 +1,14 @@ +fn difference a: int, b: int -> _/eax: int { +} + +fn test-difference { + var result/eax: int <- difference 5, 3 + check-ints-equal result, 2, "F - difference works" + result <- difference 3, 5 + check-ints-equal result, 2, "F - difference is always positive" + result <- difference 6, 6 + check-ints-equal result, 0, "F - difference can be 0" +} + +fn main screen: (addr screen) { +} |