From ee2133a13d61b3b3fb8fcf88f9c9781debd77d9e Mon Sep 17 00:00:00 2001 From: Cody Date: Thu, 29 Jun 2023 03:23:35 -0500 Subject: For loops --- examples/hello.sloth | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'examples') 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; } -- cgit v1.2.3