mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 19:32:23 -07:00
Interpreter - Structs and Arrays
This commit is contained in:
+10
-6
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user