build/ludorum.js
/** A connection game ends when either player gets the required amount of pieces aligned (either
	horizontally, vertically or diagonally), hence winning the game. The match ends in a tie if the 
	board gets full.
	*/
A connection game ends when either player gets the required amount of pieces aligned (either
horizontally, vertically or diagonally), hence winning the game. The match ends in a tie if the
board gets full.
A connection game ends when either player gets the required amount of pieces aligned ( either horizontally vertically or diagonally ) hence winning the game . The match ends in a tie if the board gets full .
function result() {
		if (this.hasOwnProperty('__result__')) {
			return this.__result__;
		}
		var lineLength = this.lineLength,
			lines = this.board.asStrings(this.__lines__(this.height, this.width, lineLength)).join(' ');
		for (var i = 0; i < this.players.length; ++i) {
			if (lines.indexOf(i.toString(36).repeat(lineLength)) >= 0) {
				return this.__result__ = this.victory([this.players[i]]);
			}
		}
		if (lines.indexOf('.') < 0) { 
			return this.__result__ = this.tied();
		}
		return this.__result__ = null; 
	}
function result ( ) { if ( this . hasOwnProperty ( '__result__' ) ) { return this . __result__ ; } var lineLength = this . lineLength , lines = this . board . asStrings ( this . __lines__ ( this . height , this . width , lineLength ) ) . join ( ' ' ) ; for ( var i = 0 ; i < this . players . length ; ++ i ) { if ( lines . indexOf ( i . toString ( 36 ) . repeat ( lineLength ) ) >= 0 ) { return this . __result__ = this . victory ( [ this . players [ i ] ] ) ; } } if ( lines . indexOf ( '.' ) < 0 ) { return this . __result__ = this . tied ( ) ; } return this . __result__ = null ; }
A connection game ends when either player gets the required amount of pieces aligned (either
horizontally, vertically or diagonally), hence winning the game.
A connection game ends when either player gets the required amount of pieces aligned ( either horizontally vertically or diagonally ) hence winning the game .
// No empty squares means a tie. // The game continues.