Solved

Javascript question

Posted on 2007-11-20
625 Views
My son asked for help and I can't help him...
any ideas???

ROFL...I KNOW it frightens you that my offspring is learning this too...lol

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 {
}
}
0
Question by:tsmithinnc

LVL 7

Expert Comment

ID: 20323809
You'll have to be more specific. What is the objective here? What does this do? What do you need help with? Do you need an explanation as to what's going on here?
0

LVL 25

Expert Comment

ID: 20323836
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 {
}
}

you need ; after every statement?
0

Author Comment

ID: 20323875
I have no idea what it is doing...he says it is giving him 14, but ...
I told him the function is saying if the length of x is 14 then he will get a prompt saying win...
otherwise fail...

is that right???
0

LVL 2

Accepted Solution

yossi_intlock earned 500 total points
ID: 20324160
this code, in generaly, intent to check a realy simple password.
its a game - if you guess the password that you win else you loose.
ive added a simple application that can show it in an html page
its quit simple - if you enter the right length value than you win else you loose.
open the file (dbl click) and try to find out what is the password :-)
the answer is: any input that its characters length is exactly 14 (thats the value of 'moo' variable).
good luck!
``````<HTML>
<SCRIPT>

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 {
}
}
function preCheck(){
check(input);
}

</SCRIPT>
<BODY>
<br/>
<br/>
</BODY>
</HTML>
``````
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…