Connecting Tech Pros Worldwide Help | Site Map

JavaScript Puzzles

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 7th, 2008, 09:55 PM
Jevgeni Kabanov
Guest
 
Posts: n/a
Default JavaScript Puzzles

Just a couple of language puzzles I compiled from a course I took
recently, quite entertaining IMHO:
http://dow.ngra.de/2008/02/28/javascript-puzzlers/

What do you think?

Jevgeni Kabanov

  #2  
Old March 7th, 2008, 10:15 PM
Joost Diepenmaat
Guest
 
Posts: n/a
Default Re: JavaScript Puzzles

Jevgeni Kabanov <ekabanov@gmail.comwrites:
Quote:
Just a couple of language puzzles I compiled from a course I took
recently, quite entertaining IMHO:
http://dow.ngra.de/2008/02/28/javascript-puzzlers/
>
What do you think?
1.2 will only work if you actually have a print() function
defined. AFAIK most browsers have a print function defined that will
print (using the printer, if there is one) the entire page regardless of
any arguments given to the print function.

The code in 2 will give an exception even before running the statements
in the questions.

The answer to question 4.1 is incorrect

All answer to question 5 are incorrect.

Question 6: see 1.2.




--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
  #3  
Old March 7th, 2008, 10:15 PM
Jevgeni Kabanov
Guest
 
Posts: n/a
Default Re: JavaScript Puzzles

You can define print() as alert(). All results were tested with Rhino
JavaScript engine, which is identical to Mozilla one (and also
developed by Mozilla). It has a built-in print() function.

Jevgeni Kabanov
Quote:
1.2 will only work if you actually have a print() function
defined. AFAIK most browsers have a print function defined that will
print (using the printer, if there is one) the entire page regardless of
any arguments given to the print function.
>
The code in 2 will give an exception even before running the statements
in the questions.
>
The answer to question 4.1 is incorrect
>
All answer to question 5 are incorrect.
>
Question 6: see 1.2.
>
--
Joost Diepenmaat | blog:http://joost.zeekat.nl/| work:http://zeekat.nl/
  #4  
Old March 7th, 2008, 10:35 PM
Joost Diepenmaat
Guest
 
Posts: n/a
Default Re: JavaScript Puzzles

Jevgeni Kabanov <ekabanov@gmail.comwrites:
Quote:
You can define print() as alert(). All results were tested with Rhino
JavaScript engine, which is identical to Mozilla one (and also
developed by Mozilla). It has a built-in print() function.
Please don't top-post. I see now that you expect the code of all
questions to be run sequentially in the same environment. You're not
making that at all clear in your page. I expect sample code to questions
to be self-contained.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.