34 lines
681 B
Plaintext
34 lines
681 B
Plaintext
animals :: import "./animals"
|
|
|
|
State :: enum(u16) {
|
|
started = animals.STATE_STARTED
|
|
running
|
|
stopped = animals.STATE_STOPPED
|
|
}
|
|
|
|
initial State :: State.started
|
|
|
|
same func(left State, right State) bool {
|
|
return left == right
|
|
}
|
|
|
|
identity c_func(value State) State {
|
|
return value
|
|
}
|
|
|
|
main func() i32 {
|
|
state State := identity(.running)
|
|
values [2]State :: [.started, State.stopped]
|
|
animal animals.Animal :: animals.Animal.dog
|
|
if same(state, .running) and
|
|
u16(State.started) == 10 and
|
|
u16(State.running) == 11 and
|
|
u16(State.stopped) == 20 and
|
|
values[0] != values[1] and
|
|
animal != animals.favorite() and
|
|
initial == State.started {
|
|
return 0
|
|
}
|
|
return 1
|
|
}
|