prog8/examples/test.p8

32 lines
671 B
Plaintext
Raw Normal View History

%import textio
%zeropage basicsafe
2022-03-13 11:52:12 +00:00
main {
2022-08-07 11:45:03 +00:00
sub start() {
ubyte c
ubyte radius = 1
ubyte[] circle_radius = [5,10,15,20,25,30]
for c in 0 to len(circle_radius)-1 {
if distance(c) < (radius as uword) + circle_radius[c]
txt.chrout('y')
else
txt.chrout('n')
cx16.r15 = (radius as uword) + circle_radius[c]
if distance(c) < cx16.r15
txt.chrout('y')
else
txt.chrout('n')
txt.nl()
}
}
sub distance(ubyte cix) -> uword {
uword sqx = cix+10
return sqrt16(sqx*sqx)
}
}