build/ludorum.js
/** Most games have victory and defeat results that cancel each other. It is said that all the
	victors wins the defeated player loses. Those games are called _zerosum games_. The method
	`zerosumResult(score, players=activePlayers)` builds a game result object for a zerosum game.
	The given score is split between the given players (the active players by default), and (-score)
	is split between their opponents.
	*/
Most games have victory and defeat results that cancel each other. It is said that all the
victors wins the defeated player loses. Those games are called _zerosum games_. The method
`zerosumResult(score, players=activePlayers)` builds a game result object for a zerosum game.
The given score is split between the given players (the active players by default), and (-score)
is split between their opponents.
Most games have victory and defeat results that cancel each other . It is said that all the victors wins the defeated player loses . Those games are called _zerosum games_ . The method ` zerosumResult ( score players = activePlayers ) ` builds a game result object for a zerosum game . The given score is split between the given players ( the active players by default ) and ( - score ) is split between their opponents .
function zerosumResult(score, players) {
		players = !players ? this.activePlayers : (!Array.isArray(players) ? [players] : players);
		score = (+score) / (players.length || 1);
		var opponentScore = -score / (this.players.length - players.length || 1);
		return iterable(this.players).map(function (player) {
			return [player, players.indexOf(player) < 0 ? opponentScore : score];
		}).toObject();
	}
function zerosumResult ( score , players ) { players = ! players ? this . activePlayers : ( ! Array . isArray ( players ) ? [ players ] : players ) ; score = ( + score ) / ( players . length || 1 ) ; var opponentScore = - score / ( this . players . length - players . length || 1 ) ; return iterable ( this . players ) . map ( function ( player ) { return [ player , players . indexOf ( player ) < 0 ? opponentScore : score ] ; } ) . toObject ( ) ; }
Most games have victory and defeat results that cancel each other.
Most games have victory and defeat results that cancel each other .