tests/lib/ludorum.js
/** A walk is a sequence of coordinates in the board that start at a given
	point and advances in a certain direction. The `walk(coord, delta)` method
	returns an iterable with coordinates from `coord` and on, adding `delta`'s 
	row and column until going off the board.
	*/
A walk is a sequence of coordinates in the board that start at a given
point and advances in a certain direction.
A walk is a sequence of coordinates in the board that start at a given point and advances in a certain direction .
function walk(coord, delta) {
		var board = this;
		return new Iterable(function __iter__() {
			var current = coord.slice();
			return function __walkIterator__() {
				if (board.isValidCoord(current)) {
					var result = current.slice();
					current[0] += delta[0];
					current[1] += delta[1];
					return result;
				} else {
					throw Iterable.STOP_ITERATION;
				}
			};
		});
	}
function walk ( coord , delta ) { var board = this ; return new Iterable ( function __iter__ ( ) { var current = coord . slice ( ) ; return function __walkIterator__ ( ) { if ( board . isValidCoord ( current ) ) { var result = current . slice ( ) ; current [ 0 ] += delta [ 0 ] ; current [ 1 ] += delta [ 1 ] ; return result ; } else { throw Iterable . STOP_ITERATION ; } } ; } ) ; }
A walk is a sequence of coordinates in the board that start at a given
point and advances in a certain direction.
A walk is a sequence of coordinates in the board that start at a given point and advances in a certain direction .