Live data from Hacker News

You Can't JavaScript Under Pressure

toys.usvsth3m.com

11–20 of 110 posts

Re: You Can't JavaScript Under Pressure

#15
post #5

Thanks for immediately playing audio without asking me first. I know everybody just loves it when web pages do that.

Because of your comment, HN will have a dozen "I am so disappointed in all of you" posts in the coming week declaring how mean everyone here is, and how it is no longer like it "once was". I hope you are happy.

I'd be happier if this page hadn't blasted music into my conference call.

Re: You Can't JavaScript Under Pressure

#16
Fun little puzzles. First 4 went pretty quickly (~8:00) and then the last one took ~7 minutes Googling around for this so I could test if a variable was an integer...

  n===+n && n===(n|0)
Wish I could see my answers after the fact though!

Edit: Read the initial requirements of the puzzle, it says sum all the integers, not all the numbers. People using (typeof i[x] == 'number') just got lucky because the test-cases didn't exercise the full requirements of the puzzle ;)

  // i will be an array, containing integers and/or arrays like itself.
  // Sum all the integers you find, anywhere in the nest of arrays.

Re: You Can't JavaScript Under Pressure

#17
It was a kinda cool thing, although I got some strange behavior when I was using `match` for determining whether the input is a filename - my regex was /.\../ (and so I did var match = i.match(/.\../) ), and match[1] was undefined - turned out match[2] was what I wanted, and it was present, but the behavior was incorrect in the reporting console in the game.

I finished this in 4 minutes.

Edit: looks like HN doesn't like asterisks

Re: You Can't JavaScript Under Pressure

#18
post #16

Fun little puzzles. First 4 went pretty quickly (~8:00) and then the last one took ~7 minutes Googling around for this so I could test if a variable was an integer... n===+n && n===(n|0) Wish I could see my answers after the fact though! Edit: Read the initial requirements of the puzzle, it says sum all the integers , not all the numbers . People using (typeof i[x] == 'number') just got lucky because the test-cases d…

typeof n === 'number'

It didn't actually require differentiating between integers and floats, just numbers and other types.

Re: You Can't JavaScript Under Pressure

#20
That was fun! I just got in to work so I was properly sleeping. I also rarely use typeof, so I had to look up that 'integer' and 'array' do not exist :) Also, what was really annoying is the use of 'i' for the argument. That's what I exclusively use for the 'for loop' index! Tripped me up a lot, I had to consciously remind myself every time I accessed the array. Last 'also', the font is WAY too big for my small screen, the comment never fit in, I had to scroll... So I think I did bad, 12 minutes. But still fun :)
Post reply on HN