Skip to content

Commit 0964b08

Browse files
committed
more example functions
1 parent c4d203f commit 0964b08

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"python.testing.unittestArgs": [
3+
"-v",
4+
"-s",
5+
".",
6+
"-p",
7+
"*_test.py"
8+
],
9+
"python.testing.pytestEnabled": false,
10+
"python.testing.unittestEnabled": true
11+
}

docs/ExampleFunctions.bs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,29 @@ func add x, y {
1212
}
1313

1414
return x;
15-
}
15+
}
16+
17+
//Function that takes two parameters and returns their difference
18+
func subtract x, y {
19+
var w;
20+
21+
(w, y) {
22+
x -;
23+
w +;
24+
}
25+
26+
return x;
27+
}
28+
29+
//Function that takes two parameters and returns their product
30+
func multiply x,y {
31+
var w;
32+
33+
(w, y) {
34+
x = add x, x;
35+
w +;
36+
}
37+
return x;
38+
}
39+
40+
//I actually could not figure out how to make a division function. If anybody figures it out, please tell me!

0 commit comments

Comments
 (0)