phetsims / plinko-probability

"Plinko Probability" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 7 forks source link

getSpacing is duplicated 4 times #61

Closed pixelzoom closed 8 years ago

pixelzoom commented 8 years ago

The function getSpacing is duplicated in Ball, GaltonBoard, BallsLayerNode and GaltonBoardNode.

/**
 * Function that returns the horizontal spacing between two pegs on the same row
 * The distance is given in the model view (with respect to the galton board)
 * @public
 * @param {number} numberOfRows
 * @returns {number}
 */
getSpacing: function( numberOfRows ) {
  return 1 / ( numberOfRows + 1 );
}
pixelzoom commented 8 years ago

"The distance is given in the model view" ?? What is "the model view"?

pixelzoom commented 8 years ago

I consolidated the 4 implementations in @static GaltonBoard.getPegSpacing.

Closing.