feat: add examples with descriptions

This commit is contained in:
samsonium
2026-10-21 04:00:48 +03:00
parent e49ebba346
commit 138d503bce
3 changed files with 92 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
// If you have some code section which is
// duplicated in program several times
// then it means your program needs some
// functions!
fn doSomeWork()
{
printline("Some work");
}
// If the function makes some kind of
// calculations then you should specify
// the result type
fn sum(int a, int b) int
{
return a + b;
}
// The `return` keyword can be used to
// actually return the value from the
// function. Also, you can specify list
// of arguments that you will use inside
// the function
int first = 5;
int second = 6;
int result = sum(first, second);
printline(result);