Skip to content

Commit

Permalink
Add 'Take' move interpretation
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Feb 23, 2016
1 parent a6c9f6d commit f62f88a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions view/index.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,15 @@ function setRepresentedFilename(filename) {

function getCurrentMoveInterpretation() {
var board = getBoard()
var tp = getCurrentTreePosition()
var ptp = gametree.navigate.apply(null, tp.concat([-1]))

if (ptp[0]) {
var prevBoard = ptp[0].nodes[ptp[1]].board

if (!helper.equals(prevBoard.captures, board.captures))
return 'Take'
}

for (var x = 0; x < board.size; x++) {
for (var y = 0; y < board.size; y++) {
Expand Down

0 comments on commit f62f88a

Please sign in to comment.