September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

16
Task/Nth/Phix/nth.phix Normal file
View file

@ -0,0 +1,16 @@
constant ordinals = {"th","st","nd","rd"}
function Nth(integer n, bool apostrophe=false)
integer mod10 = mod(n,10)+1
if mod10>4 or mod(n,100)=mod10+9 then mod10 = 1 end if
return sprintf("%d%s",{n,repeat('\'',apostrophe)&ordinals[mod10]})
end function
constant ranges = {{0,25},{250,265},{1000,1025}}
for i=1 to length(ranges) do
for j=ranges[i][1] to ranges[i][2] do
if mod(j,10)=0 then puts(1,"\n") end if
printf(1," %6s",{Nth(j,i=2)})
end for
puts(1,"\n")
end for