prog8/examples/structs.p8

32 lines
503 B
Plaintext
Raw Normal View History

2020-08-27 16:10:22 +00:00
%import c64textio
%zeropage basicsafe
2019-07-29 21:11:13 +00:00
main {
struct Color {
ubyte red
ubyte green
ubyte blue
}
sub start() {
Color purple = [255, 0, 255]
Color other
other = purple
2020-07-03 21:49:17 +00:00
other.red /= 2
other.green = 10 + other.green / 2
other.blue = 99
2020-08-27 16:10:22 +00:00
txt.print_ub(other.red)
c64.CHROUT(',')
2020-08-27 16:10:22 +00:00
txt.print_ub(other.green)
c64.CHROUT(',')
2020-08-27 16:10:22 +00:00
txt.print_ub(other.blue)
c64.CHROUT('\n')
}
}