Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,38 @@
struct Size {
mut:
width int
height int
}
fn (s &Size) area() int {
return s.width * s.height
}
struct Colors {
mut:
color string
}
struct Button {
Size
Colors
title string
}
fn main() {
mut button_1 := Button{
title: "On"
width: 4
height: 2
}
button_1.color = "red"
println(button_1)
mut button_2 := Button{
title: "Off"
height: 4
color: "blue"
}
button_2.width = 8
println("The area of button 2 is ${button_2.area()}")
}