Skip to content

Commit 418578f

Browse files
committed
add examples
1 parent b34755f commit 418578f

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

examples/EXAMPLES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Examples
2+
A collection of bread examples.
3+
4+
- hello.bread - Tests all the functions of bread (except filesystem)
5+
- fs.bread - Tests the filesystem functions

examples/fs.bread

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
str/todelete/foo
2+
str/tocreate/bar
3+
print/DELETING FOLDER foo IN 2 SECONDS!!!
4+
wait/2
5+
forcedeletedir/todelete
6+
print/Success!
7+
print/Creating folder called bar
8+
createdir/tocreate

examples/hello.bread

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
print/hello from the bread project
2+
3+
bol/foo/eoo
4+
print/mathematics test
5+
int/foo/5
6+
print/foo
7+
add/foo/5
8+
print/foo
9+
sub/foo/5
10+
print/foo
11+
mul/foo/5
12+
print/foo
13+
div/foo/5
14+
print/foo
15+
mod/foo/3
16+
print/foo
17+
print/while loop test
18+
int/foo/0
19+
while/foo/less/5
20+
print/you should see this 5 times
21+
add/foo/1
22+
endwhile/
23+
24+
shrtct/printshortcut
25+
print/im a shortcut!
26+
endshrtct/
27+
28+
print/if you input yes you will exit with return code 1
29+
in/userinput
30+
if/userinput/equals/"yes"
31+
printshortcut
32+
exit/1
33+
endif/
34+
35+
print/waiting 5 seconds
36+
wait/5
37+
print/waited 5 seconds
38+
39+

0 commit comments

Comments
 (0)