From 5271adb82f493ea1828051d23ae6854396df1b07 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 30 Oct 2016 23:48:32 +0000 Subject: Interpreter - Structs and Arrays --- code/demo.odin | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'code') 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() } -- cgit v1.2.3