Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Nth/Red/nth.red
Normal file
18
Task/Nth/Red/nth.red
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
Red[]
|
||||
|
||||
nth: function [n][
|
||||
d: n % 10
|
||||
suffix: either any [d < 1 d > 4 1 = to-integer n / 10] [4] [d]
|
||||
rejoin [n pick ["st" "nd" "rd" "th"] suffix]
|
||||
]
|
||||
|
||||
test: function [low high][
|
||||
repeat i high - low + 1 [
|
||||
prin [nth i + low - 1 ""]
|
||||
]
|
||||
prin newline
|
||||
]
|
||||
|
||||
test 0 25
|
||||
test 250 265
|
||||
test 1000 1025
|
||||
Loading…
Add table
Add a link
Reference in a new issue