I've got a function like this, within the API's sandbox:
Code: Select all
var difficultyIndex = Math.max( 0, ([EASY, MEDIUM, HARD, INSANE]).indexOf(difficulty) );
_global.addConst(
"difficultyScale",
function(/* easy, medium, hard, insane */) {
return arguments[ Math.min( arguments.length-1, difficultyIndex ) ];
}
);
I can easily test different parameter combinations, but I can't test them in relation to different 'difficultyIndex' values.
Any ideas on how to accomplish that?