finetuning
This commit is contained in:
parent
1835a94af9
commit
c2c7ccf57a
3 changed files with 10 additions and 3 deletions
|
@ -13,6 +13,12 @@
|
||||||
"type": "SequencePuzzle",
|
"type": "SequencePuzzle",
|
||||||
"seed": 1582571877,
|
"seed": 1582571877,
|
||||||
"dateEntered": "2020-02-24 19:17:57"
|
"dateEntered": "2020-02-24 19:17:57"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "hj3h5h3j5hj",
|
||||||
|
"type": "SequencePuzzle",
|
||||||
|
"seed": 1582581414,
|
||||||
|
"dateEntered": "2020-02-24 22:56:54"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -12,5 +12,6 @@ export class App {
|
||||||
|
|
||||||
this.puzzles.computePuzzle( 0 );
|
this.puzzles.computePuzzle( 0 );
|
||||||
this.puzzles.computePuzzle( 1 );
|
this.puzzles.computePuzzle( 1 );
|
||||||
|
this.puzzles.computePuzzle( 2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ export class SequencePuzzle {
|
||||||
"ADD"
|
"ADD"
|
||||||
];
|
];
|
||||||
|
|
||||||
this.length = Math.round( this.mersennetwister.randomRange( 30, 70 ) / 10 );
|
this.length = Math.max( Math.round( this.mersennetwister.randomRange( 30, 70 ) / 10 ), 5);
|
||||||
this.answerposition = ( Math.floor( this.mersennetwister.randomRange( 15, this.length * 500 ) / 10 ) - 1 ) % this.length;
|
this.answerposition = ( Math.floor( this.mersennetwister.randomRange( 15, this.length * 500 ) / 10 ) - 1 ) % this.length;
|
||||||
this.operator = this.operators[ ( Math.floor( this.mersennetwister.randomRange( 15, this.length * 500 ) / 10 ) - 1 ) % this.operators.length ];
|
this.operator = this.operators[ ( Math.floor( this.mersennetwister.randomRange( 15, this.length * 500 ) / 10 ) - 1 ) % this.operators.length ];
|
||||||
this.factor = Math.round( this.mersennetwister.randomRange( 10, 100 ) / 10 );
|
this.factor = Math.round( this.mersennetwister.randomRange( 10, 100 ) / 10 );
|
||||||
|
@ -25,7 +25,7 @@ export class SequencePuzzle {
|
||||||
this.answer = this.parts[ this.answerposition ];
|
this.answer = this.parts[ this.answerposition ];
|
||||||
this.parts[ this.answerposition ] = "?";
|
this.parts[ this.answerposition ] = "?";
|
||||||
|
|
||||||
console.log( "Puzzle id: " + this.puzzleData.id + " (seed: " + this.puzzleData.seed + ")" );
|
document.write( "Puzzle id: " + this.puzzleData.id + " (seed: " + this.puzzleData.seed + ")" + "<br>");
|
||||||
console.log( this.parts.join( " " ) );
|
document.write( this.parts.join( " " ) + "<br><br>" );
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue