Odin Notes and Examples
(top-level)

Structs, enums, and unions

When you make a struct, enum, or union, you’re making a new type.

Struct

Circle :: struct {
    id: int,
    x: f64,
    y: f64,
    r: f64,
}

c1 := Circle {
    id = 1,
    x = 1.5,
    y = 2.8,
    r = 32,
}

c2 := Circle { id = 2, x = 0, y = 0, r = 1.0 }

fmt.println(c1)
fmt.println(c2)

Enum

Union