Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
32
Task/Nth/Microsoft-Small-Basic/nth.basic
Normal file
32
Task/Nth/Microsoft-Small-Basic/nth.basic
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
loLim = 0
|
||||
hiLim = 25
|
||||
PrintImages()
|
||||
loLim = 250
|
||||
hiLim = 265
|
||||
PrintImages()
|
||||
loLim = 1000
|
||||
hiLim = 1025
|
||||
PrintImages()
|
||||
|
||||
Sub PrintImages
|
||||
For i = loLim To hiLim
|
||||
nr = i
|
||||
GetSuffix()
|
||||
TextWindow.Write(i + suffix + " ")
|
||||
EndFor
|
||||
TextWindow.WriteLine("")
|
||||
EndSub
|
||||
|
||||
Sub GetSuffix
|
||||
rem10 = Math.Remainder(nr, 10)
|
||||
rem100 = Math.Remainder(nr, 100)
|
||||
If rem10 = 1 And rem100 <> 11 Then
|
||||
suffix = "st"
|
||||
ElseIf rem10 = 2 And rem100 <> 12 Then
|
||||
suffix = "nd"
|
||||
ElseIf rem10 = 3 And rem100 <> 13 Then
|
||||
suffix = "rd"
|
||||
Else
|
||||
suffix = "th"
|
||||
EndIf
|
||||
EndSub
|
||||
Loading…
Add table
Add a link
Reference in a new issue