From b81e250fab7f54838a9b205e51a49bd5b932c618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Mon, 11 Jan 2021 15:08:35 +0100 Subject: If-statements --- tests/simple.tdy | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/simple.tdy b/tests/simple.tdy index 9d05b40..59355d2 100644 --- a/tests/simple.tdy +++ b/tests/simple.tdy @@ -13,19 +13,12 @@ // print d // print c -a int := 0 -b int := 3 -{ - a int := a + 1 - print a - - { - b int := 2 - print b - } - print b +a int := 2 +if a == 0 { + print 0 +} else if a == 1 { + print 1 +} else { + print 2 } -a = 4 -print a - // 1, 2, 3, 4 -- cgit v1.2.1