");}
}
for (var i=1; i <= nx; i++) { var j0=nx*y+i; j=2*nx*y+i+nx; //document.write(" init j0="+j0+", j="+j+" ");
document.write("
");
document.write("");
reFunc(j0,"2px 2px 0px 2px"); inFunc(j0,"0px 2px 2px 2px");
if (y==0) {
recFunc(j0,"lightgray white white lightgray"); incFunc(j0,"white white lightgray lightgray")
} else {
recFunc(j0,"white white white lightgray"); incFunc(j0,"white white lightgray lightgray");
}
document.write("
"); if (i==nx) {document.write(" "); document.write("");}
// 4 Seite
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==false && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==false) { recFunc(j0,"black black white black"); incFunc(j0,"white black black black"); } // rundum
// 3 Seiten
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==false && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==false) { recFunc(j0,"black black white black"); incFunc(j0,"white black lightgray black"); } // unten offen
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==true && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==false) { recFunc(j0,"black white white black"); incFunc(j0,"white white black black"); } //rechts offen
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==false && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==false) { recFunc(j0,"white black white black"); incFunc(j0,"white black black black"); } //oben offen
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==false && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==true) { recFunc(j0,"black black white lightgray"); incFunc(j0,"white black black lightgray"); } // links offen
//2 Seiten
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==true && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==false) { recFunc(j0,"white white white black"); incFunc(j0,"white white black black"); } // L (links & unten)
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==false && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==false) { recFunc(j0,"white black white black"); incFunc(j0,"white black lightgray black"); } // links und rechts
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==false && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==true) { recFunc(j0,"white black white lightgray"); incFunc(j0,"white black black lightgray"); } // rechts & unten
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==true && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==false) { recFunc(j0,"black white white black"); incFunc(j0,"white white lightgray black"); } // links & oben
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==true && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==true) { recFunc(j0,"black white white lightgray"); incFunc(j0,"white white black lightgray"); } // oben & unten
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==false && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==true) { recFunc(j0,"black black white lightgray"); incFunc(j0,"white black lightgray lightgray"); } // oben & rechts
//1 Seite
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==true && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==false) { recFunc(j0,"black white white black"); incFunc(j0,"white white white black"); } // nur links
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==true && testunten(j0,re[nx])==false && testrand(j0-1,re[nx])==true) { recFunc(j0,"white white white white"); incFunc(j0,"white white black white"); } // nur unten
if (testunten(j0-nx,re[nx])==true && testrand(j0,re[nx])==false && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==true) { recFunc(j0,"white black white white"); incFunc(j0,"white black white white"); } // rechts
if (testunten(j0-nx,re[nx])==false && testrand(j0,re[nx])==true && testunten(j0,re[nx])==true && testrand(j0-1,re[nx])==true) { recFunc(j0,"black white white white"); incFunc(j0,"white white lightgray white"); } // oben
}
}
// --------------------------------------------------------------------------------------------------------------------------------
// Werte setzen
for (var k=1;k<=nx*nx;k++) {
document.write(""); document.write("");
}
// --------------------------------------------------------------------------------------------------------------------------------
// Auswahlfür Grösse des Grids (3-9)
document.write(' Grösse: ');
for (var i = 3; i <= 9; i++) {
document.write(''+i+'x ');
} document.write('
');
// Auswahl der Zahl (1 - max 9 oder leer)
//document.write("");
for (var i = 1; i <= nx; i++) {
document.write("");
}
// Buttons Generieren und Lösen
document.write('