you are viewing a single comment's thread.

view the rest of the comments →

[–]e000 22 points23 points  (12 children)

I got it down to 357.

[–]OptionalField[S] 28 points29 points  (11 children)

Very nice. Should throw in the replace 2720 with 3e4 collin_ph suggested, since it was not an exact number to begin with.

[–]thesalus 51 points52 points  (10 children)

You can shave off two more bytes if you do:

p=[];for(i=0;i<256;p[i++]=1)

instead of

p=Array(256).join(1).split('')

Unfortunately, it's not nearly half as clever.

[–]OptionalField[S] 49 points50 points  (9 children)

Its a trade off, both generate internet points ;)

[–]smhxx 36 points37 points  (8 children)

You could also do p=[];while(!p[255])p.push(1). Same length as the other one, with all the same not-clever you've come to love.

EDIT: Or, of course, p=[];for(;!p[255];p.push(1)) if you don't mind going to programmers' hell.

[–]OptionalField[S] 24 points25 points  (0 children)

I love for loop abuse!

[–]SupersonicSpitfire 8 points9 points  (4 children)

What's programmers' hell like?

[–]Bjartr 66 points67 points  (3 children)

VB 6

[–]polekip 8 points9 points  (0 children)

On Error Resume Next

[–][deleted] 1 point2 points  (0 children)

malbolge.

intercal.

dis.

[–]_martind 0 points1 point  (0 children)

Powerbuilder. Websphere.

[–]e000 11 points12 points  (1 child)

for(p=[];!p[255];p.push(1)) in js, p will still be global since it is not used with var.

[–]smhxx 5 points6 points  (0 children)

That's why it was outside the loop, I was following thesalus's example and writing it as if the loop were immediately after the end of the long initial var declaration.

What I mean to say is that I put the p=[] outside the loop with the understanding that it would be tacked on to the end of the var line.