Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

14
Task/Nth/Zkl/nth-1.zkl Normal file
View file

@ -0,0 +1,14 @@
#if 0
fcn addSuffix(n){
z:=n.abs()%100;
if(11<=z<=13) return(String(n,"th"));
z=z%10;
String(n,(z==1 and "st") or (z==2 and "nd") or (z==3 and "rd") or "th");
}
#else
fcn addSuffix(n){
var suffixes=T("th","st","nd","rd","th","th","th","th","th","th"); //0..10
z:=n.abs()%100;
String(n,(z<=10 or z>20) and suffixes[z%10] or "th");
}
#endif

3
Task/Nth/Zkl/nth-2.zkl Normal file
View file

@ -0,0 +1,3 @@
[0..25] .apply(addSuffix).concat(",").println();
[250..265] .apply(addSuffix).concat(",").println();
[1000..1025].apply(addSuffix).concat(",").println();