шифровка из центра ...
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script>
var chec = function() {
for (var g = [], b = [], c = [], d = [], e = [], h = [], f = [], a = 0; 81 > a; a++) {
a % 9 || (b = [], h.push(b)), b.push(a), 9 > a ? f.push([a]) : f[a % 9].push(a), a % 3 || a % 27 || (c = [], d = [], e = [], g.push(c, d, e)), [c, d, e][a % 9 / 3 | 0].push(a);
}
var k = [].concat(g, h, f);
return function(a) {
a = [].concat.apply([], a);
return k.every(function(b) {
var c = {};
return b.every(function(b) {
b = a[b];
c[b] = (c[b] || 0) + 1;
return 2 > c[b];
});
});
};
}();
var board = [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
[ 2, 3, 4, 5, 6, 7, 8, 9, 1 ],
[ 3, 4, 5, 6, 7, 8, 9, 1, 2 ],
[ 4, 5, 6, 7, 8, 9, 1, 2, 3 ],
[ 5, 6, 7, 8, 9, 1, 2, 3, 4 ],
[ 6, 7, 8, 9, 1, 2, 3, 4, 5 ],
[ 7, 8, 9, 1, 2, 3, 4, 5, 6 ],
[ 8, 9, 1, 2, 3, 4, 5, 6, 7 ],
[ 9, 1, 2, 3, 4, 5, 6, 7, 8 ] ];
alert(chec(board)); //false
board = [
[8, 4, 5, 6, 1, 9, 3, 2, 7],
[1, 3, 2, 4, 5, 7, 6, 9, 8],
[7, 6, 9, 8, 3, 2, 5, 4, 1],
[5, 9, 6, 2, 8, 1, 7, 3, 4],
[4, 8, 3, 5, 7, 6, 2, 1, 9],
[2, 7, 1, 3, 9, 4, 8, 5, 6],
[3, 5, 7, 9, 4, 8, 1, 6, 2],
[6, 1, 4, 7, 2, 5, 9, 8, 3],
[9, 2, 8, 1, 6, 3, 4, 7, 5]
]
alert(chec(board));//true
</script>
</head>
<body>
<div id="slider"></div>
</body>
</html>