Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
33
Task/Inheritance-Single/Odin/inheritance-single.odin
Normal file
33
Task/Inheritance-Single/Odin/inheritance-single.odin
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package main
|
||||
|
||||
Animal :: struct {
|
||||
alive: bool
|
||||
}
|
||||
|
||||
Dog :: struct {
|
||||
using animal: Animal,
|
||||
obedience_trained: bool
|
||||
}
|
||||
|
||||
Cat :: struct {
|
||||
using animal: Animal,
|
||||
litterbox_trained: bool
|
||||
}
|
||||
|
||||
Lab :: struct {
|
||||
using dog: Dog,
|
||||
color: string
|
||||
}
|
||||
|
||||
Collie :: struct {
|
||||
using dog: Dog,
|
||||
catches_frisbee: bool
|
||||
}
|
||||
|
||||
main :: proc() {
|
||||
pet : Lab
|
||||
|
||||
pet.alive = true
|
||||
pet.obedience_trained = true
|
||||
pet.color = "yellow"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue