Skip to main content
Post Closed as "Not suitable for this site" by Alex A.
Now that I know the better way :)
Source Link
nicael
  • 4.8k
  • 24
  • 43

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";foralert(i=4;i<8;i++){x+=([0][1]+"")[i];}alert.slice(x4,8);)

alerts "fine" - jsfiddlejsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index islice(4,8) from "undefined" (from second to eighth index) and adds itoutputs fifth to variableeight characters of wordundefined


This is underhanded popularity contest.

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

alert(([0][1]+"").slice(4,8))

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. slice(4,8) outputs fifth to eight characters of undefined


This is underhanded popularity contest.

deleted 111 characters in body
Source Link
Doorknob
  • 71.7k
  • 20
  • 143
  • 385

Round 3 is cancelled. Winner - gnibbler.

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

Round 3 is cancelled. Winner - gnibbler.

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

Notice removed Draw attention by nicael
Bounty Ended with Dennis's answer chosen by nicael
deleted 220 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43

Produce an unexpected word [Round 2]

#Round 2 #4 hours left! Vote! gnibbler wins again? Looks like that!
First round ended with gnibbler's answer, but Dennis's answerRound 3 was upvoted since, so they have the same score now - 32is cancelled.
Please do not just vote on the first two answers Winner - other answers deserve votes too!gnibbler.


**Preparations for Round 3**: I need 201 rep to start Round 3, because minimal bounty amount doubles each time I offer a bounty. So you understand :)

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

Produce an unexpected word [Round 2]

#Round 2 #4 hours left! Vote! gnibbler wins again? Looks like that!
First round ended with gnibbler's answer, but Dennis's answer was upvoted since, so they have the same score now - 32.
Please do not just vote on the first two answers - other answers deserve votes too!


**Preparations for Round 3**: I need 201 rep to start Round 3, because minimal bounty amount doubles each time I offer a bounty. So you understand :)

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

Produce an unexpected word

Round 3 is cancelled. Winner - gnibbler.

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word).

Example (JavaScript):

var x="";for(i=4;i<8;i++){x+=([0][1]+"")[i];}alert(x);

alerts "fine" - jsfiddle.

Explanations:

1. [0][1] returns undefined, because there only one element in array [0]
2. Adding empty string converts undefined to string "undefined"
3. [i] takes character at index i from "undefined" (from second to eighth index) and adds it to variable word


This is underhanded popularity contest.

added 54 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
deleted 33 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
added 161 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
added 100 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Notice added Draw attention by nicael
Bounty Started worth 100 reputation by nicael
added 200 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
deleted 192 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Notice removed Authoritative reference needed by nicael
Bounty Ended with gnibbler's answer chosen by nicael
added 196 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Tweeted twitter.com/#!/StackCodeGolf/status/475304079497756672
added 102 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Notice added Authoritative reference needed by nicael
Bounty Started worth 50 reputation by nicael
added 58 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Post Reopened by user12205, Michael M., ProgramFOX, johnchen902, Timtech
added 86 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Post Closed as "Not suitable for this site" by Martin Ender, ProgramFOX, John Dvorak, user16402, A.L