Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Nth/Liberty-BASIC/nth.basic
Normal file
32
Task/Nth/Liberty-BASIC/nth.basic
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
call printImages 0, 25
|
||||
call printImages 250, 265
|
||||
call printImages 1000, 1025
|
||||
end
|
||||
|
||||
sub printImages loLim, hiLim
|
||||
loLim = int(loLim)
|
||||
hiLIm = int(hiLim)
|
||||
for i = loLim to hiLim
|
||||
print str$(i) + suffix$(i) + " ";
|
||||
next i
|
||||
print
|
||||
end sub
|
||||
|
||||
function suffix$(n)
|
||||
n = int(n)
|
||||
nMod10 = n mod 10
|
||||
nMod100 = n mod 100
|
||||
if (nMod10 = 1) and (nMod100 <> 11) then
|
||||
suffix$ = "st"
|
||||
else
|
||||
if (nMod10 = 2) and (nMod100 <> 12) then
|
||||
suffix$ = "nd"
|
||||
else
|
||||
if (NMod10 = 3) and (NMod100 <> 13) then
|
||||
suffix$ = "rd"
|
||||
else
|
||||
suffix$ = "th"
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue