mirror of
https://github.com/irmen/prog8.git
synced 2024-09-08 10:55:08 +00:00
txtelite with input loop
This commit is contained in:
parent
0bbb2240f2
commit
56d530ff04
@ -1,5 +1,7 @@
|
|||||||
%import textio
|
%import textio
|
||||||
%import conv
|
%import conv
|
||||||
|
%option no_sysinit
|
||||||
|
%zeropage basicsafe
|
||||||
|
|
||||||
; Prog8 adaptation of the Text-Elite galaxy system trading simulation engine.
|
; Prog8 adaptation of the Text-Elite galaxy system trading simulation engine.
|
||||||
; Original C-version obtained from: http://www.elitehomepage.org/text/index.htm
|
; Original C-version obtained from: http://www.elitehomepage.org/text/index.htm
|
||||||
@ -30,18 +32,19 @@ main {
|
|||||||
|
|
||||||
repeat {
|
repeat {
|
||||||
str input = "????????"
|
str input = "????????"
|
||||||
txt.print("\nEnter system number 0-255: ")
|
txt.print("\nEnter system number 0-255 q=quit: ")
|
||||||
void txt.input_chars(input)
|
void txt.input_chars(input)
|
||||||
ubyte system = lsb(conv.str2uword(input))
|
if input[0]=='q'
|
||||||
|
break
|
||||||
|
|
||||||
|
ubyte systemNr = lsb(conv.str2uword(input))
|
||||||
galaxy.init(1)
|
galaxy.init(1)
|
||||||
repeat system+1 {
|
galaxy.generate_next_planet() ; always at least planet 0 (separate to avoid repeat ubyte overflow)
|
||||||
|
repeat systemNr {
|
||||||
galaxy.generate_next_planet()
|
galaxy.generate_next_planet()
|
||||||
}
|
}
|
||||||
planet.display(false)
|
planet.display(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
txt.print("\nEnter to exit: ")
|
|
||||||
void c64.CHRIN()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
asmsub testX() {
|
asmsub testX() {
|
||||||
|
Loading…
Reference in New Issue
Block a user