Javascript Mission 3: Math time!

Time for a math test. This time faith is aiming to test our math skills. Lets see, what she has got for us.

var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3
function check(x)
     if (x.length == moo)
           window.location += "?lvl_password="+x;
     } else {
           alert("fail D:");

After checking out the source code, you can see that the length of the word you will enter is passed to function check which is then compared to moo. So, lets just find out moo.

After calculations you will find that, variable foo has the value 47 and variable bar has value of 7. How? ‘%'(percentage sign) in almost all programming languages is used as modulus, which is used to find the remainder, here 47 divided by 8 gives remainder 7. And therefore moo has the value of 14. Any string with the length of 14 will do.

Good luck!!!

2 Replies to “Javascript Mission 3: Math time!”

Leave a Reply