Skip to content

Instantly share code, notes, and snippets.

@tetsuzuki tetsuzuki/Move.js
Created Mar 5, 2014

Embed
What would you like to do?
function PiecePos(rank,file,piece){
this.rank = rank;
this.file = file;
this.piece = piece;
}
PiecePos.prototype = {
Add: function(pos1,pos2){
this.rank = pos1.rank + pos2.rank;
this.file = pos1.file + pos2.file;
},
Multiply: function(pos,num){
this.rank = pos.rank * num;
this.file = pos.file * num;
}
}
function Move(from,to,piece,promotion,capture){
this.from = from;
this.to = to;
this.piece = piece;
this.promotion = promotion;
this.capture = capture;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.