diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-10-30 23:48:32 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-10-30 23:48:32 +0000 |
| commit | 5271adb82f493ea1828051d23ae6854396df1b07 (patch) | |
| tree | 918bade279109460a5eb447d74a1947cff136b24 /code | |
| parent | 0ffe4b600df51fd8ee5658f9a9296efe86cb67ea (diff) | |
Interpreter - Structs and Arrays
Diffstat (limited to 'code')
| -rw-r--r-- | code/demo.odin | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/code/demo.odin b/code/demo.odin index b29ef97ec..f6dfdefc5 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -1,11 +1,15 @@ -#import "fmt.odin" +x: i64 = 123 + +Vec2 :: struct { + x, y: i64 +} main :: proc() { - foo :: proc(x: i64) -> i64 { - return -x + 1 + bar :: proc() -> i64 { + a := [3]i64{7, 4, 2} + v := Vec2{a[0], 2} + return v.x } - x, y: i64 = 123, 321 - y = x + 2 - y - x = foo(y) + bar() } |