## javascript mission 3

Learn the basics of how to exploit JavaScript.

### Re: javascript mission 3

---Edited---

Posting answers is not allowed. User is now banned for second offense.
jm970
New User

Posts: 2
Joined: Thu May 29, 2008 2:40 pm
Blog: View Blog (0)

### Re: javascript mission 3

thank you
“If I lose the light of the sun, I will write by candlelight, moonlight, no light. If I lose paper and ink, I will write in blood on forgotten walls. I will write always."
blackprince491
Poster

Posts: 209
Joined: Thu May 15, 2008 12:23 pm
Blog: View Blog (0)

### Re: javascript mission 3

I really hope this isn't a spoiler...
A lot of people seem to think that 'foo % 8' means '8% of foo' or 'foo% of 8' or even 'foo/8'.
hejjagheterjens
New User

Posts: 1
Joined: Wed Jun 04, 2008 6:42 am
Blog: View Blog (0)

### ok i REALLY REALLY need some help *may contain TINY spoiler*

:ugeek: ok I have gotten like 3 or 4 different numbers...and tried MANY different calculations. now keep in mind 8% is equal to 0.08. i have tried (5+(6*7)0.08*2, ive tried 5+6(7*0.08*2), 5+6*7(0.08*2), etc. now i understand that x.length == moo, so it doesnt matter what the password i so long as the length is the same. i have gotten 3,4,5,31,32,33,54,and 27 character answer to the math (assuming the decimal is counted in the answer itself). i have tried the javascript:alert(var); code and it does nothing on the firefox browser... im wondering if its just the browser or if that was done on purpose, so that the answer couldnt just be given...

now, i know the answer is just staring me in the face laughing is fool head off at me...but i just...cant seem to grasp it...

If anyone can help me out at all, i would really appreciate it...

--Shane

PS. am i just thinking too hard or too complicated?
shanebane363
New User

Posts: 8
Joined: Sun Jun 08, 2008 10:27 am
Blog: View Blog (0)

### Re: javascript mission 3

*Possible spoiler*

If you haven't gotten it by now think about x.length and what it might mean.

If this is a spoiler pm me and I will change it right away.
and btw I'm pretty sure that the lightning bolt means that somebody has posted in that thread recently.

*edit* Also check to make sure you have js enabled otherwise you will never know if your getting the question right or wrong.
Dogt03
New User

Posts: 3
Joined: Tue Jun 03, 2008 11:05 pm
Blog: View Blog (0)

### Re: javascript mission 3

Hi shanebane,
I think that you're on the right track. But youd have a big mistake there. In programming-languages the % doesn't mean percent. It's the modulo operator. a%b means divide a/b and take the rest.
for example: 5 % 3 = 2 (as 5/3 = 1 with the rest 2)
Now do your calculations again and you should make it.
berstbest
New User

Posts: 8
Joined: Sun Jun 08, 2008 1:47 pm
Blog: View Blog (0)

### Re: javascript mission 3

var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3
function check(x)
{
if (x.length == moo)
{
} else {
}
}

if (x.length == moo)

Firstly You will Want To Notice This Line Here, This Basically sets The Mission.

var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3

You will then need to move onto this section here, Read and follow basically. I cant make it any simpler than that.
If you stil ldont understand it i recommend using www.htmlite.com to learn javascript. It really isnt a hard mission even if oyu dont know javascript at all.
mosshack
New User

Posts: 18
Joined: Wed Apr 30, 2008 4:59 pm
Blog: View Blog (0)

### Re: javascript mission 3

When i got it It said level up but in the source it should say win????
podolop
New User

Posts: 2
Joined: Fri Jun 13, 2008 2:21 pm
Blog: View Blog (0)

### Re: javascript mission 3

I hope this isnt too much of a spoiler because it actually takes javascript knowledge but what i did since i couldnt figure out the whole alert thing (it didnt work for me for some reason) is i made my own webpage and c/p the code onto my page. Then i just simply wrote document.write(moo)
Justjealouse
New User

Posts: 6
Joined: Thu May 29, 2008 8:18 pm
Blog: View Blog (0)

### Re: javascript mission 3

OK maybe im being dumb here.

I know what moo is (not thrown by the modulus), and I know what x.length means. I enter my answer of x characters and i even get the query string ?lvl_password={my_pass} appended to the URL so I must have entered the TRUE branch of the IF statement - yet I still get an incorrect password alert - not even the 'Fail D:' message...

EDIT: nvm, a hint for anyone else thats getting stuck here remember that mathematical operators have an order of precedence
Mindzai
New User

Posts: 7
Joined: Tue Jun 17, 2008 4:06 pm
Blog: View Blog (0)

PreviousNext