build/ludorum.js
/** If all pieces are put in a circle, each piece beats half the pieces next to it, and it is 
	beaten by half the pieces before it. For example if `allPieces` where `[0,1,2,3,4]`:
	
	+ piece `1` would beat pieces `2` and `3`, and lose against `4` and `0`,
	+ piece `2` would beat pieces `3` and `4`, and lose against `0` and `1`,
	+ piece `4` would beat pieces `0` and `1`, and lose against `2` and `3`,
	
	The `moveResult` returns 1 if `piece1` beats `piece2` or -1 if otherwise.
	*/
If all pieces are put in a circle, each piece beats half the pieces next to it, and it is
beaten by half the pieces before it.




If all pieces are put in a circle each piece beats half the pieces next to it and it is beaten by half the pieces before it .
function moveResult(piece1, piece2) {
		var upperBound = iterable(this.allPieces).max(0) + 1;
		if (piece1 < piece2) {
			return piece2 - piece1 <= (upperBound / 2) ? 1 : -1;
		} else if (piece1 > piece2) {
			return piece1 - piece2 >= (upperBound / 2) + 1 ? 1 : -1;
		} else {
			return 0;
		}
	}
function moveResult ( piece1 , piece2 ) { var upperBound = iterable ( this . allPieces ) . max ( 0 ) + 1 ; if ( piece1 < piece2 ) { return piece2 - piece1 <= ( upperBound / 2 ) ? 1 : - 1 ; } else if ( piece1 > piece2 ) { return piece1 - piece2 >= ( upperBound / 2 ) + 1 ? 1 : - 1 ; } else { return 0 ; } }
If all pieces are put in a circle, each piece beats half the pieces next to it, and it is
beaten by half the pieces before it.
If all pieces are put in a circle each piece beats half the pieces next to it and it is beaten by half the pieces before it .