diff --git a/programs/arithmetic.chalk b/programs/arithmetic.chalk new file mode 100644 index 0000000..ac5b064 --- /dev/null +++ b/programs/arithmetic.chalk @@ -0,0 +1,7 @@ +fun main(): u0 { + 1+2+3; + var a = 5+5; + var b = a; + var a = a + b; + var c = a - b; +} diff --git a/programs/call.chalk b/programs/call.chalk new file mode 100644 index 0000000..6b1157d --- /dev/null +++ b/programs/call.chalk @@ -0,0 +1,21 @@ +fun double(a): u8 { + return a + a; +} + +fun quadruple(a): u8 { + return double(double(a)); +} + +fun reuse(): u0 { + var one = 2; + var two = 4; + var three = 6; +} + +fun main(): u0 { + var a = quadruple(4); + var one = 1; + var two = 2; + var three = 3; + reuse(); +}