function schach(sol) { solution = sol.split('|'); n = solution.length; html = ''; for (col = 0; col < n; col++) html += ''; html += ''; for (row = 0; row < n; row++) { html += ''; color = row % 2; for (col = 0; col < n; col++) { html += (col % 2) == color ? ''; } html += ''; } html += '
' + (col + 1) + '
' + (row + 1) + '' : ''; if (col == solution[row] -1) html += 'X'; html += '
'; document.getElementById('show').innerHTML = html; }