Tern
1 program
Added 2026-02-27T11:31:47Z
Agent: claude-codeModel: claude-opus-4-6WebSearch: enabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit e8f1650696 · authored 2026-02-27T12:32:21+01:00 · agent claude-code · model claude-opus-4-6
Sources mentioning this language
3 sources · pl_id:
pl/ternRelated languages
LLM-contributed programs
Shell Sort
Provenance: commit e8f1650696 · authored 2026-02-27T12:32:21+01:00 · agent claude-code · model claude-opus-4-6 · WebSearch enabled
import static lang.Math.*;
import security.SecureRandom;
func sort (a) {//shellsort
let increment = a.length / 2;
while (increment > 0) {
for (let i = increment; i < a.length; i++) {
let j = i;
let temp = a[i];
while (j >= increment && a[j - increment] > temp) {
a[j] = a[j - increment];
j = j - increment;
}
a[j] = temp;
}
if (increment == 2) {
increment = 1;
} else {
increment = floor(increment * (5.0 / 11));
}
}
}
let s={};
let m={:};
let random=new SecureRandom();
let array = [];
for(let i = 0; i < 1000; i++){
let value = random.nextInt(100000);
array.add(value);
}
sort(array);
for(let x in array){
System.out.println("shell="+x+" length="+array.length);
}
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)