From 4297d105e6c5ae103a51db5aefa9d33bb684d742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaj=20Bj=C3=B6rklund?= Date: Mon, 11 Nov 2013 22:20:35 +0200 Subject: [PATCH] Remove commented out code --- src/position.js | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/position.js b/src/position.js index cebd523..77b57fe 100644 --- a/src/position.js +++ b/src/position.js @@ -910,46 +910,3 @@ Chess.Position.prototype.unmakeMove = function() { return move; }; - -/* -function test() { - var cache = new Array(1000000); - var collisions = 0; - var hits = 0; - - function perft(depth, chessPosition) { - if (!depth) { - return 1; - } - - var zobrist = chessPosition.hashKey; - var hashKey = zobrist.getHashKey(); - - if (cache[hashKey % cache.length]) { - if (cache[hashKey % cache.length].zobrist.isEqual(zobrist)) { - ++hits; - return cache[hashKey % cache.length].nodes; - } - ++collisions; - } - - var nodes = 0; - - chessPosition.getMoves(true).forEach(function(move) { - if (chessPosition.makeMove(move)) { - nodes += perft(depth - 1, chessPosition); - chessPosition.unmakeMove(); - } - }); - - cache[hashKey % cache.length] = { zobrist: zobrist.dup(), nodes: nodes }; - - return nodes; - } - - window.console.log("Perft: " + perft(4, new Chess.Position)); - window.console.log("Hits: " + hits + ", collisions: " + collisions); -}; - -test(); -*/