diff options
| author | Cody <cody@codyq.dev> | 2023-06-26 23:41:21 -0500 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-06-26 23:41:21 -0500 |
| commit | a3c5134ee7581168947df8a050c332d7cb7aa426 (patch) | |
| tree | 01631812f37e4c3d124928a14f169796c58a7a0e /examples/hello.sloth | |
| parent | 8c9bd55e161ba5fcaea626a1db2e0b685ac4f096 (diff) | |
| download | sloth-a3c5134ee7581168947df8a050c332d7cb7aa426.tar.gz | |
Strings and so much more
Diffstat (limited to 'examples/hello.sloth')
| -rw-r--r-- | examples/hello.sloth | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/examples/hello.sloth b/examples/hello.sloth index db71b01..13415a9 100644 --- a/examples/hello.sloth +++ b/examples/hello.sloth @@ -1,40 +1,6 @@ -fn test() [Int] { - var list: [Int] = [500, 5, 7]; +foreign fn print(x: String) Void; - vpushi(list, 3); - vpushi(list, 3); - vpushi(list, 3); - vpushi(list, 5); - - var x: Int = vpopi(list); - vpushi(list, x); - vpushi(list, x * 2); - vpushi(list, x * 3); - - return list; -} - -fn testtwo(list: [Int]) Int { - #vpopi(list); - var x: Int = vpopi(list); - return x; -} - -fn testthree(list: [Int]) Int { - var x: Int = vlen(list); - return x; -} - -foreign fn testback(x: Int) Void; - -fn testfour(list: [Int]) Int { - vseti(list, 0, 888); - var i: Int = 0; - while i < vlen(list) { - var value: Int = vgeti(list, i); - testback(value); - i = i + 1; - } +fn main() Int { + print("gaming\n"); return 0; } - |
