I would like to share the same enthousiasm as my fellow CodeCombaters in this thread, but I think I’ll share my negative feedbacks about this level, which I hope will be constructive.
First of all (positive), I like the use of the modulo function for the SWITCH part : changing periodically the sign of a variable is adapted to use of the modulo function.
SKIP part is fine too, I guess… It feels more like an excuse to use a modulo, but why not. Although I’m not a fan of the “minus one” in the following if statement and might put an unecessary difficulty, when the Guide is suggesting to check if sideSteps is divisible by SKIP. Didn’t work for me, but worked when steps -1 was, as shown below :
if ((steps-1)%SKIP===0){
But now, here is my real wrong feeling about this level : the SLIDE part. First, it’s not mentionned in the guide, but :
// (1)
if (sideSteps<1) {
sideSteps+=SLIDE;
}
if (sideSteps>SLIDE) {
sideSteps-=SLIDE;
}
is equivalent to :
// (2)
sideSteps = ( ( sideSteps - 1 ) % SLIDE ) + 1 ;
So 1st negative feedback : the use of a modulo function on the SLIDE part of this level seems VERY counter intuitive. We’re using an artificial not-continuous function (modulo) to set the next position of a Heros (which is by essence continuous as a physical function). And the motion isn’t set as in old school mario where you appear on the other side of the screen when out of boundaries, but the level makes your hero actually go to the other side THROUGH the field which is counter intuitive to me. Why not teleporting him ? At least that would make sense to me rather than WALKING from 1 to SLIDE or from SLIDE to 1.
I love the idea to teach people how to wrap around arrays and stuff, but I think in this very case of the SLIDE part, it’s not helping much to learn what a modulo is actually useful for.
2nd negative feedback : My personal preference when it comes to modulo in my programs is : never use a 1-based array when you can use a 0-based array. It’s so confusing to modify the natural interval of possible results from [ 0 , n-1 ] to [ 1 , n ]. I consider a “not optimal” way to to teach “how modulo makes things easy” when your exercice asks for a [ 1 , (SLIDE-1) +1 ] interval of work.
3rd negative feedback : The modulo function is bugged in JavaScript for the negative numbers, which makes learning a bit more difficult. That doesn’t help a new comer who has the correct idea to understand what’s wrong in his own program. Again : modulo is supposed to be much simplier than any other way to code periodic stuff. And when I solved Lost Viking, I didn’t feel that way.
I hope I wasn’t too harsh in my comments. I love the level, the ideas in it. I just think it’s a hard level with unecessary difficulty, and might discourage good faith students. Hope this is constructive. Have a good day.
posting and then editing for typos