Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Need some JavaScript puzzles
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Oltmans  
View profile  
 More options Sep 27 2008, 8:08 pm
Newsgroups: comp.lang.javascript
From: Oltmans <rolf.oltm...@gmail.com>
Date: Sat, 27 Sep 2008 17:08:27 -0700 (PDT)
Local: Sat, Sep 27 2008 8:08 pm
Subject: Re: Need some JavaScript puzzles
On Sep 27, 7:07 am, Conrad Lender <crlen...@yahoo.com> wrote:

> On 2008-09-27 03:18, Jorge wrote:

> >> Define function add such that>
> >>      add(3)(4)
> >> returns 7.

> > javascript:alert((function add (p) { var a=p; return function (p)
> > { return a+p } })(3)(4))

> You don't need to create an extra variable.

> function add (first) {
>     return function (second) {
>         return first + second;
>     }

> }

> But hey!
> Don't spoil the fun for the OP by posting the solution!

> @Douglas:
> I'd also appreciate more puzzles if you know any. This kind of (simple
> but interesting) problem is a godsend when you're teaching kids.

I absolutely agree with you. We need some puzzles like that. I really
liked that puzzle. This is exactly the kind of puzzle that I wanted to
solve. I mean a puzzle that would force me hard to think about the
language constructs and this one just did that.

Also, I thank others who posted their invaluable comments.

> The only thing I've seen recently that comes close to a puzzle is this
> website:

>  http://parentnode.org/static/challange2.html

> You need to enter the correct password, that's all. No rewards :-) It's
> not pretty, rather the opposite, but if you like obfuscation, it might
> be interesting. Syntax highlighting helps.

>   - Conrad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.