prog8/examples/test.p8

26 lines
739 B
Plaintext
Raw Normal View History

%import floats
%import math
2024-11-24 00:53:09 +01:00
%import textio
%zeropage basicsafe
main {
sub start() {
floats.print(floats.interpolate(0, 0, 10, 1000, 2000))
txt.spc()
txt.print_uw(math.interpolate(10, 10, 20, 100, 200))
txt.nl()
floats.print(floats.interpolate(2.22, 0, 10, 1000, 2000))
txt.spc()
txt.print_uw(math.interpolate(12, 10, 20, 100, 200))
txt.nl()
floats.print(floats.interpolate(5.0, 0, 10, 1000, 2000))
txt.spc()
txt.print_uw(math.interpolate(15, 10, 20, 100, 200))
txt.nl()
floats.print(floats.interpolate(10, 0, 10, 1000, 2000))
txt.spc()
txt.print_uw(math.interpolate(20, 10, 20, 100, 200))
txt.nl()
2024-11-08 19:43:59 +01:00
}
}