From f2b0dc0066f840035ab0fef8179c5344d5b3edca Mon Sep 17 00:00:00 2001 From: denz1994 Date: Mon, 24 Dec 2018 12:06:51 -0500 Subject: [PATCH] Added REVIEW comments https://github.com/phetsims/fractions-common/issues/29 --- js/building/model/ShapePiece.js | 1 + js/game/model/FractionLevel.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/js/building/model/ShapePiece.js b/js/building/model/ShapePiece.js index 8c8199c..c78e041 100644 --- a/js/building/model/ShapePiece.js +++ b/js/building/model/ShapePiece.js @@ -162,6 +162,7 @@ define( require => { return Vector2.ZERO; } else { + // REVIEW: 'let' instead of 'var' var positiveAngle = fraction.value * 2 * Math.PI; // Compute the centroid for a circular sector diff --git a/js/game/model/FractionLevel.js b/js/game/model/FractionLevel.js index 30604b7..a74ba1c 100644 --- a/js/game/model/FractionLevel.js +++ b/js/game/model/FractionLevel.js @@ -1468,7 +1468,10 @@ define( require => { * @returns {FractionChallenge} */ static level5Numbers( levelNumber ) { - const shapeTargets = FractionLevel.targetsFromPartitions( choose( 3, ShapePartition.LIMITED_9_GAME_PARTITIONS.filter( partition => partition.length > 1 ) ), COLORS_3, d => sample( inclusive( 1, d - 1 ) ), FillType.SEQUENTIAL ); + const shapeTargets = FractionLevel.targetsFromPartitions( + choose( 3, ShapePartition.LIMITED_9_GAME_PARTITIONS.filter( partition => partition.length > 1 ) ), + COLORS_3, d => sample( inclusive( 1, d - 1 ) ), FillType.SEQUENTIAL + ); const pieceNumbers = FractionLevel.exactNumbers( shapeTargets.map( target => target.fraction ) ); return FractionChallenge.createNumberChallenge( levelNumber, false, shapeTargets, pieceNumbers ); @@ -1649,7 +1652,10 @@ define( require => { * @returns {FractionChallenge} */ static level10Numbers( levelNumber ) { - const shapeTargets = FractionLevel.targetsFromPartitions( choose( 4, ShapePartition.LIMITED_9_GAME_PARTITIONS ), COLORS_4, d => sample( inclusive( 1, 2 * d ) ), FillType.MIXED ); + const shapeTargets = FractionLevel.targetsFromPartitions( + choose( 4, ShapePartition.LIMITED_9_GAME_PARTITIONS ), + COLORS_4, d => sample( inclusive( 1, 2 * d ) ), FillType.MIXED + ); const pieceNumbers = FractionLevel.withMultipliedNumbers( shapeTargets.map( target => target.fraction ), 2, false ); return FractionChallenge.createNumberChallenge( levelNumber, false, shapeTargets, pieceNumbers );