From 6000d5d8b5aeececd2aa4e519a552a3098eecb33 Mon Sep 17 00:00:00 2001 From: xerox Date: Sat, 18 Jan 2020 18:56:37 -0800 Subject: [PATCH] added to example program --- examples/hello_world.dn | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/examples/hello_world.dn b/examples/hello_world.dn index 64318a1..57364f9 100755 --- a/examples/hello_world.dn +++ b/examples/hello_world.dn @@ -1,7 +1,20 @@ -def Main : { - printf["hello world"]; - printf["wtf2"]; - printf["wtf1"]; +// another function +def AnotherFunction : { + printf["Hello from another function!"]; }; + +// every program needs a main :) +def Main : { + // define variables + a = 10; + b = 20; + + // print statements + printf["a + b: "]; + printf[{ int } a + b]; + + // calling functions + call AnotherFunction; +}; call Main;