mirror of
https://github.com/irmen/prog8.git
synced 2024-11-24 13:32:28 +00:00
9438e996d7
Added math.lerpw() a LERP routine for words (to complement the existing math.lerp() for bytes) Described the LERP routines in the library chapter in the docs.
20 lines
354 B
Lua
20 lines
354 B
Lua
%import math
|
|
%import textio
|
|
%option no_sysinit
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
sub start() {
|
|
uword v0 = 4000
|
|
uword v1 = 60000
|
|
|
|
for cx16.r1 in 65400 to 65535 {
|
|
txt.print_uw(cx16.r1)
|
|
txt.spc()
|
|
txt.spc()
|
|
txt.print_uw(math.lerpw(v0, v1, cx16.r1))
|
|
txt.nl()
|
|
}
|
|
}
|
|
}
|