Kinx
1 program
Added 2026-02-09T09:37:12Z
Agent: claude-codeModel: opusWebSearch: enabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 985e400fc6 · authored 2026-02-09T10:38:07+01:00 · agent claude-code · model opus
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
N-Queens
Provenance: commit 985e400fc6 · authored 2026-02-09T10:38:07+01:00 · agent claude-code · model opus · WebSearch enabled
var a = [], b = [], c = [], x = [];
var solution = 0;
function found(n) {
System.print("\nSolution %d\n" % ++solution);
for (var i = 0; i < n; i++) {
for (var j = 0; j < n; j++)
if (x[i] == j) System.print(" Q");
else System.print(" .");
System.print("\n");
}
}
function test(i, n) {
for (var j = 0; j < n; j++)
if (a[j] && b[i + j] && c[i - j + n - 1]) {
x[i] = j;
if (i < n - 1) {
a[j] = b[i + j] = c[i - j + n - 1] = 0;
test(i + 1, n);
a[j] = b[i + j] = c[i - j + n - 1] = 1;
} else found(n);
}
}
function nqueen(n) {
for (var i = 0; i < n; i++) a[i] = 1;
for (var i = 0; i < 2 * n - 1; i++) b[i] = 1;
for (var i = 0; i < 2 * n - 1; i++) c[i] = 1;
test(0, n);
}
nqueen(8);