-
Notifications
You must be signed in to change notification settings - Fork 0
/
if.vsl
45 lines (38 loc) · 927 Bytes
/
if.vsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
func main(a) begin
if a<10 then
print "a is less than 10"
if a>-5 then
print "a is more than -5"
else
print "a is less than or equal to -5"
if a = 5 then
print "a is equal to 5"
if a != 0 then begin
print "a is not equal to 0"
if a = 6 then
print "a is however 6"
else if a = 7 then
print "a is however 7"
else if a = 10 then
print "a is however 10"
else
print "a is neither 0, 6, 7 or 10, but ", a
end
end
//TESTCASE: 4
//a is less than 10
//a is more than -5
//a is not equal to 0
//a is neither 0, 6, 7 or 10, but 4
//TESTCASE: 0
//a is less than 10
//a is more than -5
//TESTCASE: 10
//a is more than -5
//a is not equal to 0
//a is however 10
//TESTCASE: -20
//a is less than 10
//a is less than or equal to -5
//a is not equal to 0
//a is neither 0, 6, 7 or 10, but -20