mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-08-16 14:29:00 +00:00
62 lines
796 B
Plaintext
Executable File
62 lines
796 B
Plaintext
Executable File
;
|
|
; Include all imported modules and their data/functions.
|
|
;
|
|
|
|
include(stdlib.plh)
|
|
include(testlib.plh)
|
|
|
|
;
|
|
; Declare all global variables for this module.
|
|
;
|
|
|
|
byte hello[] = "Hello, world.\n"
|
|
word struct[] = 1, 10, 100, 1000, 10000
|
|
byte spaces[] = " "
|
|
|
|
;
|
|
; Define functions.
|
|
;
|
|
|
|
def tens(start)
|
|
word i
|
|
i = start
|
|
repeat
|
|
print:hex(i)
|
|
print:str(@spaces)
|
|
print:dec(i)
|
|
print:newln()
|
|
i = i / 10
|
|
until i == 0
|
|
end
|
|
|
|
def ascii
|
|
byte i
|
|
i = 32
|
|
while i < 128
|
|
putc(i)
|
|
i = i + 1
|
|
loop
|
|
end
|
|
|
|
def nums(range)
|
|
word i
|
|
for i = range downto -range step range/10
|
|
puti(i)
|
|
putln
|
|
next
|
|
end
|
|
|
|
export def main(range)
|
|
cls
|
|
nums(*range)
|
|
tens(*range*10)
|
|
viewport(12, 12, 16, 8)
|
|
ascii
|
|
viewport(0, 0, 40, 24)
|
|
gotoxy(15,5)
|
|
puts(@hello)
|
|
end
|
|
|
|
main(@struct:6)
|
|
done
|