Skip to content

Commit

Permalink
Added REVIEW comments #29
Browse files Browse the repository at this point in the history
  • Loading branch information
Denz1994 committed Dec 24, 2018
1 parent a18d661 commit f2b0dc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/building/model/ShapePiece.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions js/game/model/FractionLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit f2b0dc0

Please sign in to comment.