index.js
function () {
			var localSequence = this.game;
			var moves = 0;
			while(localSequence) {
				moves += localSequence.nodes.length;

				if (localSequence.sequences) {
					localSequence = localSequence.sequences[0];
				} else {
					localSequence = null;
				}
			}

			// TODO: Right now we're *assuming* that the root node doesn't have a
			// move in it, which is *recommended* but not required practice.
			// @see http://www.red-bean.com/sgf/sgf4.html
			// "Note: it's bad style to have move properties in root nodes.
			// (it isn't forbidden though)"
			return moves - 1;
		}
function () {
			var localSequence = this.game;
			var moves = 0;
			while(localSequence) {
				moves += localSequence.nodes.length;

				if (localSequence.sequences) {
					localSequence = localSequence.sequences[0];
				} else {
					localSequence = null;
				}
			}

			// TODO: Right now we're *assuming* that the root node doesn't have a
			// move in it, which is *recommended* but not required practice.
			// @see http://www.red-bean.com/sgf/sgf4.html
			// "Note: it's bad style to have move properties in root nodes.
			// (it isn't forbidden though)"
			return moves - 1;
		}
function ( ) { var localSequence = this . game ; var moves = 0 ; while ( localSequence ) { moves += localSequence . nodes . length ; if ( localSequence . sequences ) { localSequence = localSequence . sequences [ 0 ] ; } else { localSequence = null ; } } // TODO: Right now we're *assuming* that the root node doesn't have a // move in it, which is *recommended* but not required practice. // @see http://www.red-bean.com/sgf/sgf4.html // "Note: it's bad style to have move properties in root nodes. // (it isn't forbidden though)" return moves - 1 ; }
Get the total number of moves in a game
Get the total number of moves in a game