prog8/examples/test.p8

31 lines
501 B
Plaintext
Raw Normal View History

%import textio
%zeropage basicsafe
%option no_sysinit
2021-10-27 21:48:02 +00:00
2021-10-30 13:15:11 +00:00
main {
sub start() {
ubyte @shared bb
2021-12-06 20:43:17 +00:00
if bb + sin8u(bb) > 100-bb {
bb++
}
2021-12-06 20:43:17 +00:00
while bb + sin8u(bb) > 100-bb {
bb++
}
do {
bb++
} until bb + sin8u(bb) > 100-bb
const ubyte EN_TYPE=2
uword eRef = $c000
ubyte chance = rnd() % 100
if eRef[EN_TYPE] and chance < (eRef[EN_TYPE] << 1) {
bb++
}
}
}