diff options
| author | Cody <cody@codyq.dev> | 2023-06-29 03:23:35 -0500 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-06-29 03:23:35 -0500 |
| commit | ee2133a13d61b3b3fb8fcf88f9c9781debd77d9e (patch) | |
| tree | 66c6a075f732e4feabfa57e0e188bc52f55051af /examples | |
| parent | c8a987daefa1475b1902b9823e8d2ef4500943cd (diff) | |
| download | sloth-ee2133a13d61b3b3fb8fcf88f9c9781debd77d9e.tar.gz | |
For loops
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/hello.sloth | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth index 8f42051..5aa54e9 100644 --- a/examples/hello.sloth +++ b/examples/hello.sloth @@ -1,19 +1,7 @@ fn main() Int { - var x: [Int] = [5]; - vpopi(x); - var i: Int = 0; - while i < 100 { - vpushi(x, randGen(0, 100)); - i = i + 1; + var i: Int = 10; + for j in 0..i { + print(istr(j)); } - - var y: Int = vgeti(x, 42); - var y: Int = vgeti(x, 45); - var y: Int = vgeti(x, 41); - var y: Int = vgeti(x, 49); - println(istr(y)); - - - print("Hello World\n"); return 0; } |
