mirror of
https://github.com/irmen/prog8.git
synced 2024-11-23 07:32:10 +00:00
46 lines
1009 B
Lua
46 lines
1009 B
Lua
%import textio
|
|
%import math
|
|
%import floats
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
|
|
sub printnumbers() {
|
|
txt.print_ub(math.rnd())
|
|
txt.spc()
|
|
txt.print_ub(math.rnd())
|
|
txt.spc()
|
|
txt.print_ub(math.rnd())
|
|
txt.nl()
|
|
txt.print_uw(math.rndw())
|
|
txt.spc()
|
|
txt.print_uw(math.rndw())
|
|
txt.spc()
|
|
txt.print_uw(math.rndw())
|
|
txt.nl()
|
|
floats.print_f(floats.rndf())
|
|
txt.spc()
|
|
floats.print_f(floats.rndf())
|
|
txt.spc()
|
|
floats.print_f(floats.rndf())
|
|
txt.nl()
|
|
}
|
|
|
|
|
|
sub start() {
|
|
txt.print("initial:\n")
|
|
math.rndseed($a55a, $7653)
|
|
floats.rndseedf(11,22,33)
|
|
printnumbers()
|
|
txt.print("\nsame seeds:\n")
|
|
math.rndseed($a55a, $7653)
|
|
floats.rndseedf(11,22,33)
|
|
printnumbers()
|
|
txt.print("\ndifferent seeds:\n")
|
|
math.rndseed($1234, $5678)
|
|
floats.rndseedf(44,55,66)
|
|
printnumbers()
|
|
txt.nl()
|
|
}
|
|
}
|