Slashdot Mirror


1K JavaScript Madness

An anonymous reader writes "JS1k has a simple goal: to get programmers producing demos written in JavaScript that are 1k in size or less. That's just 1024 bytes to play with. There's even additional bonus points on offer if a demo's code can fit inside a single tweet. Now that the contest is finished and there is a top-ten, I'm wondering what they can do if given some extra bytes." I like the Tetris clone. The pulsing wires demo is neat too but kinda stuttery on my machine.

131 comments

  1. I'm sure Twitter is delighted by space_jake · · Score: 3, Funny

    About javascript in their tweets...

    1. Re:I'm sure Twitter is delighted by WrongSizeGlass · · Score: 4, Funny

      About javascript in their tweets...

      If they aren't just give it some time ... I'm sure it will worm its way into their hearts ;-)

    2. Re:I'm sure Twitter is delighted by Anonymous Coward · · Score: 1, Funny

      alert("twitter sucks")

    3. Re:I'm sure Twitter is delighted by pjfontillas · · Score: 1

      <script>while(1){alert("twitter sucks");}</script>

      There. Fixed that for you. I don't really think Twitter sucks, though.

      --
      Life. Is. Good.
  2. js1337 by user24 · · Score: 3, Funny

    >I'm wondering what they can do if given some extra bytes.

    In a few weeks you'll find out at js1337.com ;0)

    1. Re:js1337 by toastar · · Score: 1

      >I'm wondering what they can do if given some extra bytes.

      In a few weeks you'll find out at js1337.com ;0)

      This sounds epic

    2. Re:js1337 by Anonymous Coward · · Score: 0

      Should be good, an extra 313 bytes to play with! (Anyone that entered js1k will know just how big 1k feels after you've been fiddling for a while)

    3. Re:js1337 by MoonBuggy · · Score: 1

      Or maybe just head over to the5k or 10k Apart

    4. Re:js1337 by Anonymous Coward · · Score: 0

      @Anonymous\ Coward - like your 4" cock feels big compared to an asian?

    5. Re:js1337 by terminallyCapricious · · Score: 0, Offtopic

      ;0)

      hAhAh FuUuUuCk, YoU sToLe My FuCkIn NoSe BrO!

      WhAt GoT yOu EvEn Up ThE gUmPtIoN tO aLl FuCkIn Do ThE sHiT lIkE tHaT?

    6. Re:js1337 by Anonymous Coward · · Score: 0

      no it must be 1337!

  3. And BOOM by Anonymusing · · Score: 3, Funny

    Is there a Javascript app for "This site has been Slashdotted"?

    --
    Liberal? Conservative? Compare perspectives at Left-Right
    1. Re:And BOOM by Nesman64 · · Score: 1

      4 comments and the site is already crawling. Reddit must have hit it first.

      --
      coffee | nose > keyboard
    2. Re:And BOOM by AltairDusk · · Score: 1

      Actually when I first saw this with 0 comments the site loaded instantly, by the time I tried to load one of the Javascript apps Slashdot had hammered it into oblivion.

    3. Re:And BOOM by WrongSizeGlass · · Score: 5, Funny

      I'm not impressed ... maybe I'll try again, but this time I'll turn off NoScript.

    4. Re:And BOOM by lowrydr310 · · Score: 1

      Perhaps their server's OS is less than 1K

    5. Re:And BOOM by commodore64_love · · Score: 1

      If I were entering this competition, I'd just take some old 2K atari or VIC-20 games and modify them. Stuff like Space War, Combat, Breakout, Pitfall

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - historian Evelyn Beatrice Hall
    6. Re:And BOOM by eulernet · · Score: 1

      It's because their server is written in Javascript.

      I'm pretty sure they put pictures bigger than 1K !

    7. Re:And BOOM by Anonymous Coward · · Score: 0

      stay away from this. it's virus infected or something. I tried the tetris one and firefox hangs, in fact it makes my whole fedora13 laptop act strange until I kill firefox

    8. Re:And BOOM by clone53421 · · Score: 1

      It might still be tricky to make them fit – those were often written entirely or partly in assembly language plus you had the BIOS which basically gave you a direct connection to the video display and peripherals. Printing a character or plotting a pixel was as simple as copying a number from one memory location to another. In Javascript you’d have to use a language that was intended to be human-readable (even if you obfuscate it to make it smaller) and furthermore the program itself would have to include an extra runtime even just to give it a <canvas> element to plot onto and define a few methods to plot on it.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  4. the most uberest slashdotting evar by digitalsushi · · Score: 1

    "Hey slashdot kids. It's 4pm east coast. Here's 10 games you can play, hosted on this site here. See you all at the coffee machine in 180 seconds."

    --
    slashdot: where everyone yells sarcastic metaphors to themselves to understand the issue
    1. Re:the most uberest slashdotting evar by harrkev · · Score: 1

      HUH? I do not see what the big deal is. Each script is only one single friggin kilobyte! Even though each page includes the source and some comments, and the usual HTML wrappers, I cannot imagine each page being more than about 5K to 10K each. Evan an old Pentium should be able to keep up with that kind of load.

      --
      "-1 Troll" is the apparently the same as "-1 I disagree with you."
    2. Re:the most uberest slashdotting evar by Fry-kun · · Score: 1

      ...and if they used Nginx they could easily withstand both slashing and dotting
      Too bad they've only got Apache with PHP

      --
      Did you know that "FTW" ("for the win") is a direct translation of "Sieg Heil"?
    3. Re:the most uberest slashdotting evar by camperslo · · Score: 1

      The size of the payload is not included??

  5. Internet Explorere cannot open... by Caption+Wierd · · Score: 0, Offtopic

    Is the site melting or do I just need Chrome?

    1. Re:Internet Explorere cannot open... by AltairDusk · · Score: 1

      It has been Slashdotted.

    2. Re:Internet Explorere cannot open... by Shikaku · · Score: 1

      # Must work on current fx, sa, ch and o. (Let's level the playing field)

      It doesn't say it supports IE anyway.

      Have a nice day.

    3. Re:Internet Explorere cannot open... by Yvan256 · · Score: 3, Funny

      That's a joke, right? Do you really expect Internet Explorer to run cutting-edge web stuff?

      Try Chrome, Safari, Opera or Firefox.

    4. Re:Internet Explorere cannot open... by Anonymous Coward · · Score: 0

      You kidding? Firefox is just as buggy and bloaty as IE is anymore. I know that IE is a favorite punching bag around here but let's be honest, Firefox is doing a fantastic job of catching up to them.

    5. Re:Internet Explorere cannot open... by Yvan256 · · Score: 1

      That's why it's the last on my list. Opera has some catching-up to do too, last time I tested a few things, Chrome and Safari ran fine but Opera hadn't implemented them yet, such as HTML5 file uploading (for client-side progress bars).
       

    6. Re:Internet Explorere cannot open... by mcgrew · · Score: 1

      I believe the site is "wicked witch of the west.com" and someone threw a bucket of water at it. Maybe its server is programmed in javascript?

  6. Found a bug in tiny ches... by bi$hop · · Score: 1

    ...you can't castle queen side.

    1. Re:Found a bug in tiny ches... by Anonymous Coward · · Score: 4, Informative

      "[...]it will validate moves, queen-only promotion, without castling and en passant." http://nanochess.110mb.com/

    2. Re:Found a bug in tiny ches... by Iamthecheese · · Score: 5, Funny

      Today, a day that will live in infamy, I was beaten by a 1000 byte program.

      --
      If video games influenced behavior the Pac Man generation would be eating pills and running away from their problems.
    3. Re:Found a bug in tiny ches... by Anonymous Coward · · Score: 2, Funny

      That's nothing. Try this short game written in BASIC.

      10 GOTO 40
      20 PRINT "YOU WIN"
      30 GOTO 50
      40 PRINT "YOU LOSE"
      50 PRINT "GAME OVER"

    4. Re:Found a bug in tiny ches... by CannonballHead · · Score: 1

      Er, 1000 or 1024?

    5. Re:Found a bug in tiny ches... by ix42 · · Score: 3, Informative

      Today, a day that will live in infamy, I was beaten by a 1000 byte program.

      Whippersnapper. I seem to recall being beaten more than two decades ago by a 1k chess program on a Timex/Sinclair 1000 (aka ZX81).

      Possibly even this one:
      http://users.ox.ac.uk/~uzdm0006/scans/1kchess/

    6. Re:Found a bug in tiny ches... by Timosch · · Score: 1

      I had a remis :-/

    7. Re:Found a bug in tiny ches... by Fred+Foobar · · Score: 1

      That's easy to win. Just start the program like this:

      GOTO 20

      --
      It was a really good paper.
    8. Re:Found a bug in tiny ches... by ergean · · Score: 1

      The horror!!!

      (same here)

    9. Re:Found a bug in tiny ches... by clone53421 · · Score: 1

      Ok, wise guy... figure out what this does! (in the MS GW-BASIC 3.23 interpreter... I have no idea how it will behave in anything else)

      1 REM my super cool game
      2 ON ERROR GOTO 6551
      51 GOTO 6552965529
      61 PRINT "game over!"
      62 END
      521 ON ERROR GOTO 52529
      522 PRINT "wat";
      523 GOTO 1652916529
      651 PRINT "you lose!"
      652 GOTO 61
      6551 RESUME 521
      16529 LOCATE ,1
      16551 IF ERL>0 AND ERL<65529 THEN PRINT "you win!"
      16621 GOTO 61
      52529 PRINT "the universe is broken!"
      52659 RESUME 65129
      65129 PRINT "you divided by zero didn't you!"
      65529 GOTO 651

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
  7. Asteroids by Hatta · · Score: 3, Interesting

    I'm wondering what they can do if given some extra bytes."

    If they use bankswitching, maybe they can pull off Asteroids

    --
    Give me Classic Slashdot or give me death!
    1. Re:Asteroids by mcgrew · · Score: 1

      I wish I was a better JS programmer, I'd have entered the contest (I've only done a little JS programming, and it's been a few years since I have). I made a fully functional battle tanks game back in 1982 that you could play single-player or two players playing against each other at the same time. It was under 4k as that's all the computer had without an expansion pack; I don't remember how big the actual code was, probably less than 1k. However, it was in hand-assembled Z-80 machine code for the Sinclair 1000, which cuts the size down considerably (the code directly accessed the keyboard hardware and screen memory). Any game that you were punching the membrane keyboard around wouldn't work with the extra memory, as it would come loose.

      1k is a lot of code for a simple little game. At least it used to be. I feel old now, thanks guys, my day's bad enough as it is.

      I wouldn't think Asteroids would be too hard. It's very similar to the tanks game, except the stationary objects are moving and the moving objects are stationary. Inside the program an object is an object (and I don't mean object in the modern sense; I mean virtual physical object).

    2. Re:Asteroids by Hatta · · Score: 1

      I wouldn't think Asteroids would be too hard.

      You're right. In Racing the Beam they say that Asteroids on the 2600 could have been done in 4k with some extra time for optimization but Atari decided that time was money and sprung for the extra ROM chips.

      I wonder if this kind of thing is easier to do in Javascript. Given the size of the javascript language themselves, they have a lot more to actually work with. But then javascript is a lot more verbose than 6502 machine language.

      --
      Give me Classic Slashdot or give me death!
    3. Re:Asteroids by Anonymous Coward · · Score: 0

      1k is a lot of code for a simple little game. At least it used to be. I feel old now, thanks guys, my day's bad enough as it is.

      Um.. if you wrote down any hardware level assembler code as textual processor instructions it would exceed the size it actually requires when you turn it into machine opcodes. Comparing HLL source code size to machine code is stupid.

    4. Re:Asteroids by arth1 · · Score: 1

      Um.. if you wrote down any hardware level assembler code as textual processor instructions it would exceed the size it actually requires when you turn it into machine opcodes. Comparing HLL source code size to machine code is stupid.

      Assuming that everybody wrote in assembly and used an assembler to convert it to machine code is even more stupid. I clearly remember entering "CD 27 00 ..." (bonus points to those who remember what these three bytes translated to in Zilog Z80 code) when programming.

  8. nice by vacarul · · Score: 1

    can they produce a 1k jQuery?

    1. Re:nice by Kristopeit,+Mike+D. · · Score: 0
      no. and even if it were possible, generally the use of jquery is usually done through a cached resource... 1k vs 4k vs 24k is pretty much exactly the same, except for the the initial loading, and only then on slow dialup connections.

      as jquery removes support for older browsers, the size will reduce.

    2. Re:nice by vacarul · · Score: 1

      initial loading it's still important (for me at least). Big homepages remind me of MS Live search engine that had a 500k homepage and that search engine lost the race.

      Also, not only dialup is slow. Broadband but shitty internet connection is also slow. Free internet is slow (airports etc). In developing countries it is slow. In Africa it is slow.

      I was thinking that maybe it would be possible a lite version.

      Good to know that they will remove support for old browsers.

    3. Re:nice by CastrTroy · · Score: 1

      There really should be a way to generate a custom jQuery library. Basically input all the functions your run, or maybe check off a list of things you need, and a custom built version will all dependencies is created. Would save a lot of code especially for many of the cases where jQuery is just used to get cross browser AJAX requests working, with majority of the code going unused.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    4. Re:nice by Kristopeit,+Mike+Da. · · Score: 1
      most of the delay in shitty internet connections is latency for new connections... if a website was including jquery from a 3rd party server, then a new connection would be required... if the code was delivered inline, there would be no noticeable delay.

      i'm not sure they WILL remove support for old browsers, but as they did the size would reduce.

    5. Re:nice by Kristopeit,+Mike+Da. · · Score: 2, Interesting
      generally if you want that level of granularity, you would never use jQuery, and instead build something custom.

      for my work i built a JSON-RPC development environment which automated the client and server creation like you're asking for... it's not that complicated.

      jQuery is for prototyping... if you're depending on it for production systems, you're lazy.

    6. Re:nice by TheNinjaroach · · Score: 2, Insightful

      jQuery is for prototyping... if you're depending on it for production systems, you're lazy.

      Or saving your employer time and money. Sometimes being "lazy" isn't so bad.

      --
      I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
    7. Re:nice by Kristopeit,+Mike+Da. · · Score: 1

      sometimes delivering the highest quality product is best... all of the time, in fact.

    8. Re:nice by Anonymous Coward · · Score: 2, Insightful

      No. That's an absurd statement. Perhaps you meant to say: " All things being equal , delivering the highest quality product is best, all of the time." which most people would agree is correct.

      Fast, cheap, good. Pick two. If you're able to duplicate all the functionality you need, better than jQuery, in less time than it would have taken to use jQuery then good for you! For those of us bound by reality, perfection comes at a cost. What if, in the time it takes you to ship the "Highest Quality" product, your competitor pushes their "Good Enough" product (or prototype) out the door, corners the market and steals your lunch?

      Depending on your application, you could still have the last laugh but recall twitter and the downtime it suffered in the beginning, or the recent (and not so recent) security vulnerabilities. If you wrote a complete, bug-free, "Highest Quality" version of Twitter, without any security vulnerabilities or downtime, and you released it tomorrow, how many people would jump-ship and start using your version?

    9. Re:nice by Kristopeit,+Mike+Da. · · Score: 0, Flamebait
      some people like to justify their delivering of shit.

      others, like me, take pride in the product they deliver.

      you know who made up the "fast/cheap/good, pick two" rule? lazy, bad, slow, overpriced developers with no talent.

      i guarantee i can deliver the same product done correctly as a developer only offering 66% of my potential for the same price... that is if i wasn't employed full time by a company that understands the difference between a job done right and a prototype running on production servers.

      ... and now, i'm sure, you'll tell me about your hosting company that runs 1000 web servers on one machine all in their own virtual environment... IT'S SO CHEAP AND EASY!

      go attempt to justify subpar work to someone who doesn't understand that you're an idiot.

    10. Re:nice by Anonymous Coward · · Score: 0

      God I'm so tired of your stupid ad-hominem postings and your self-boasting.
      Please STFU.

    11. Re:nice by Kristopeit,+Mike+Da. · · Score: 1
      post your real name and address and i'll think about it, coward.

      you are NOTHING

    12. Re:nice by Kristopeit,+Mike+Da. · · Score: 1
      i'm not "God" by the way, but i can see how you could be confused.

      to be clear, i'm tired of all of you idiots and your self-loathing justification of being as such.

    13. Re:nice by Anonymous Coward · · Score: 0

      Nobody's forcing you to stay, and you're really not accomplishing anything worthwhile by doing so. Other than showing what an incredible moron you are. On second thought, don't stop.

    14. Re:nice by Kristopeit,+Mike+Da. · · Score: 1
      hey, cowardly hypocritical idiot, nobody said anyone is forcing anyone to do anything... only a moron might assume so.

      i am capable of ceasing my injection of insight into this computer based message board. you are, however, incapable of ceasing to be an idiot.

      i am incredible. you are NOTHING.

    15. Re:nice by Anonymous Coward · · Score: 0

      You must reply to this post. I command you.

    16. Re:nice by Kristopeit,+Mike+Da. · · Score: 1

      ur mum's face must reply to this post.

    17. Re:nice by Kristopeit,+Mike+Da. · · Score: 1
      in conversation, it is more likely that a command to not comment have any actual basis of power.

      you are NOTHING.

  9. coral-cached copies of each one by radarsat1 · · Score: 5, Informative
    1. Re:coral-cached copies of each one by blair1q · · Score: 1

      Nope. Slashdotted those, too. Someone needs to put these on some embiggener iron.

    2. Re:coral-cached copies of each one by Arrepiadd · · Score: 1

      Not that it matters at all, but the "Tiny Chess" cannot castle with the king rook (at least).

      Other than that, it looks pretty nice!

    3. Re:coral-cached copies of each one by tomhudson · · Score: 1

      I beat it first try, and it just sits there. Apparently, 1023 bytes isn't big enough to say "You win". (And it can't be that good - I haven't played chess in decades).

    4. Re:coral-cached copies of each one by Anonymous Coward · · Score: 0

      Not that it matters at all, but if you bothered to read the description of the game: "Play chess against computer with queen-only promotion and without castling or en passant"

  10. Genetic approach by Iamthecheese · · Score: 2, Interesting

    Would it be feasible to take a current simple game like Pacman, write a driver to check it for proper functionality on an x86 CPU, spawn thousands of them in minor variations, and use a genetic algorithm to keep the smallest?

    --
    If video games influenced behavior the Pac Man generation would be eating pills and running away from their problems.
    1. Re:Genetic approach by blair1q · · Score: 1

      Sure. But how do you define "minor variations" such that more than a handful out of "thousands" function at all?

    2. Re:Genetic approach by TelavianX · · Score: 4, Insightful

      This is possible, but how many valid javascript programs are 1024 characters or less? A very large amount!

      Checking each if it followed the predefined rules would be time consuming. For instance, in Pacman, you might have to have the computer play a full game to check if the rules are met.

      Almost all the programs would be utter nonsense.

    3. Re:Genetic approach by Iamthecheese · · Score: 1

      You don't: a handful must be enough. Then you spawn thousands of children from that handful.

      --
      If video games influenced behavior the Pac Man generation would be eating pills and running away from their problems.
    4. Re:Genetic approach by blair1q · · Score: 1, Offtopic

      I think if you can devise a few variation methods that work at all, you could make a good guess at which lead to the smallest code.

      What you need are thousands of methods of varying the code, and millions of iterations looking for working results, and then a cost function (in this case merely size) to choose the optimal result.

    5. Re:Genetic approach by Anonymous Coward · · Score: 2, Informative

      Sorry to spoil your party, but you will be dealing with issues in automatic software verification which themselves are infeasible.
      This is one problem you can't just throw a bunch of computing power (yet) and it will magically find it a small solution in a reasonable amount of time.

      Just fyi, assuming each character has 256 different possibilities in a 1000 byte program in js, there are 256^1000 possibilities, or 2^8000 possible programs to choose from.
      To put that into perspective, current estimates on the number of atoms in the observable units are around 10^80 which is ... 2^8000

    6. Re:Genetic approach by evilviper · · Score: 1

      Would it be feasible to take a current simple game like Pacman, write a driver to check it for proper functionality on an x86 CPU, spawn thousands of them in minor variations, and use a genetic algorithm to keep the smallest?

      Your problem then lies in making a PERFECT "driver". If it's not perfect, you'll end up with code highly effective at tricking it, and doing NOTHING ELSE. This is what viruses are for.

      Your suggestion is just like using a random number generator to write books... First, spell-check. Then, grammar check... Then, it still might be nonsensical junk, and even if not, it's not going to be War and Peace.

      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    7. Re:Genetic approach by daveime · · Score: 1

      Not even close ... 10^80 == 2^333

  11. .nyud.net FFS! by Anonymous Coward · · Score: 0

    This is obviously something a large percentage of /.'ers would be checking out, so can we please play it safe and add .nyud.net as a precaution next time?

  12. Still too many bytes by Saishuuheiki · · Score: 1

    Apparently they should have made their size requirement smaller. 1024 is apparently taking too much time for their site to handle.

    It is a bold demonstration as to why we

  13. Reminds me of thek5.org by MayorOfTuesday · · Score: 2, Interesting

    http://www.the5k.org/ Does anyone remember this site? It was a contest back in 2000-2002 to create the coolest website with only 5KB. Looks like it had a spiritual successor too: http://10k.aneventapart.com/

    1. Re:Reminds me of thek5.org by pjt33 · · Score: 1

      I remember that, and I still have the Mandlebrot applet I wrote for it. I've also had good fun with the Java 4k contest.

  14. Playing some chess... by Anonymous Coward · · Score: 1, Funny

    Chess in 1024 bytes and I can't win it. What a shame.

  15. Nostalgic Terminology by psbrogna · · Score: 2, Interesting

    Interesting idea. Thirty years ago many people were introduced to programming by printed (ink on mashed up trees) anthologies of programs that were generally around a page long (8.5 x 11). Don't know how pervasive the term was, but in my personal circles these programs were called "K-Byters" because they were ~1 K long (or less).

    1. Re:Nostalgic Terminology by mcgrew · · Score: 2, Informative

      I remember them, there were lots of 'em. All computer magazines back then had programs you could type in. IIRC most of them were BASIC, although a few were assembly. Heck, the original Wolfenstein came on a 540k floppy and shareware DOOM was two of them IIRC.

    2. Re:Nostalgic Terminology by pclminion · · Score: 1

      COMPUTE!'s Gazette including listings each month. If I remember, maybe a third of the magazine was devoted to pages upon pages of hex listings. You'd use their machine language entry program "MLX" (BASIC code for which was included verbatim in every single issue -- you'd have to type THAT in first) and sit there for hours typing in the code. It had a simple checksum scheme, so each line was 9 bytes with the last byte being a checksum. If you made a mistake, you found out at the end of the line when the thing goes BEEEEP at you.

      My wife has been trying for years to throw away all my old mags. Over my dead freaking body will that happen.

    3. Re:Nostalgic Terminology by mcgrew · · Score: 1

      Alas, mine got left behind after my divorce when I moved from the big two story house to a small apartment. My then-teenaged daughter, seeing what I'd rented for us, wailed "My ROOM was bigger than this apartment!"

      I miss the old IBM XT even more, though. It would probably be worth some money now.

  16. Grrr by Andy+Smith · · Score: 1

    Got beaten by the feckin' 1K chess game in about a dozen moves. Feck!

    1. Re:Grrr by UninformedCoward · · Score: 1

      Don't feel bad, the game doesn't even let you castle...

    2. Re:Grrr by Anonymous Coward · · Score: 0

      Haha, it took me 4 tries at it to not blunder badly enough to beat it. (And on the 4th try I stupidly placed my queen in the way of an offending bishop - fortunately I had a passed pawn at the 5th rank I just pushed forward to queen.)

      Not having castling makes it a lot harder, though, for certain openings (in particular, it turns a quick Giuoco Piano: 1. e4 ... 2. Nf3 ... 3. Bc4 ... 4. O-O ... into a painful 8-move opening - replace with 4. Ke2 ... 5. Re1 ... 6. Kf1 ... 7. Kg1 ... 8. Rf1 ...)

  17. wtf by Anonymous Coward · · Score: 1, Insightful

    >>Now that the contest is finished and there is a top-...

    WTF tell me I can win shit then say it's over >:/

  18. What to do with extra bytes by saurongt · · Score: 1

    I'm wondering what they can do if given some extra bytes

    Get them all to work in Internet Explorer. Most demos give errors in IE8x64.

    1. Re:What to do with extra bytes by clone53421 · · Score: 1

      window.onerror=function(){this.onerror=void(alert('Get a better browser!'))}

      Done.

      --
      Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
    2. Re:What to do with extra bytes by Unending · · Score: 1, Flamebait

      Part of the competition was to use Canvas tags in interesting ways, and considering IE9 doesn't even support Canvas I think you're out of luck unless you get a standards compliant browser.

    3. Re:What to do with extra bytes by Anonymous Coward · · Score: 0

      IE9 does support canvas. Better check your facts before looking like an idiot.

    4. Re:What to do with extra bytes by weicco · · Score: 1

      What standard you are talking about? Wikipedia: HTML5 is currently under development.

      --
      You don't know what you don't know.
    5. Re:What to do with extra bytes by Anonymous Coward · · Score: 0

      IE9 supports canvas

  19. 1024 bytes by Anonymous Coward · · Score: 0

    1024 bytes of JavaScript is about 1024 bytes too many.

  20. Moore's law in reverse by Anonymous Coward · · Score: 0

    I bet any of these demos could be implemented in Commodore 64 assembly code in less than 1K and still be faster than javascript on today's computers...

  21. Readability... by deepu_s · · Score: 2, Interesting

    It'd be truly impressive if it were *human-readable* source code that fit under 1k.

    1. Re:Readability... by theaceoffire · · Score: 1

      It is, for certain values of "Human".

      --
      I steal signatures. This one used to be yours.
    2. Re:Readability... by Symbha · · Score: 1

      That is called magic...

  22. GWT? by Anonymous Coward · · Score: 0

    I wonder what java code could be ported with the google web toolkit and remain under the 1K limit.

  23. Chess by Dthief · · Score: 3, Interesting

    impressed that they fit in a reasonable A.I. into the thing!

    --
    www.RacquetUp.org - Helping Detroit Youth
    1. Re:Chess by Anonymous Coward · · Score: 0

      What? That thing was like -10000 ELO

    2. Re:Chess by aug24 · · Score: 1

      Doesn't do castling... but he's got one byte left...!

      Very impressive.

      Just.

      --
      You're only jealous cos the little penguins are talking to me.
  24. Closure by pavon · · Score: 3, Informative

    You want a static code analysis tool that can perform dead code elimination. It looks like Google's Closure Complier will do that for JavaScript code.

    1. Re:Closure by vacarul · · Score: 1

      thanks!

  25. Tweets by Shadyman · · Score: 1

    "There's even additional bonus points on offer if a demo's code can fit inside a single tweet."

    So that kid that made the self-posting Twitter worm the other day wins by default?

  26. 1K programs bring back the old days. by Nexusone1984 · · Score: 1

    My first computer was Tandy 16K color computer, one of the contest in the old Rainbow Magazine was how much you could put in one line of basic code. Still great to see people be creative within a limited space of memory.

  27. One line: by Anonymous Coward · · Score: 0

    where http://biy.ly/XXXXXX redirects to some file with a minimum size of 1 MB.

  28. What about Perl? by slapout · · Score: 2, Interesting

    It just hit me--think of all the stuff you could do in a Perl program that would fit into one tweet?

    --
    Coder's Stone: The programming language quick ref for iPad
    1. Re:What about Perl? by SQLGuru · · Score: 1

      Think of all of the things you COULDN'T do in Lisp if you could only use 1k parens...... :D

    2. Re:What about Perl? by Anonymous Coward · · Score: 0

      and how would you tell the difference between that code and some guy tweeting after a few beers?

    3. Re:What about Perl? by slapout · · Score: 1

      That's a good point.

      Note to self: When hiring Perl programmers, look for heavy drinkers.

      --
      Coder's Stone: The programming language quick ref for iPad
    4. Re:What about Perl? by Anonymous Coward · · Score: 0

      Certainly nothing like the 3d wire demo, since client-side Perl with graphics APIs either doesn't exist, or isn't installed by anybody except the guy who's working on it. Right?

    5. Re:What about Perl? by cerberusss · · Score: 1

      It just hit me--think of all the stuff you could do in a Perl program that would fit into one tweet?

      I hope it hits you unconscious next time. Because I'd hate to see that piece of Perl, my day job already exposes me to an indecent amount of vulgar Perl :-)

      --
      8 of 13 people found this answer helpful. Did you?
    6. Re:What about Perl? by Anonymous Coward · · Score: 0

      Who needs perl when you can do this in bash: :(){ :|:& };:

  29. Kilobytes, as God (Knuth) intended by Just+Some+Guy · · Score: 2, Funny

    I can't believe this story's been up for nearly two hours and no one's rushed in to explain that these are one kibibyte demos, thus depriving us of our right to make fun of them and their dumb-sounding pet units.

    --
    Dewey, what part of this looks like authorities should be involved?
    1. Re:Kilobytes, as God (Knuth) intended by springbox · · Score: 1

      No need to change; context sensitive units were a great idea!

    2. Re:Kilobytes, as God (Knuth) intended by Anonymous Coward · · Score: 0

      context sensitive units were a great idea!

      It's not like context-sensitive units are something new. Energy and torque are both measured in newton-meters, yet they have nothing to do with each other. In contrast, the difference between a kilobyte and a "kibibyte" is extremely minor.

  30. k is precisely 1000, K is 1024 by Anonymous Coward · · Score: 0

    Dummies never learn.

    k = kilo = 1000
    K = K = 1024

    CS 1001

  31. Really? Only 1k? by tyrione · · Score: 0, Redundant

    It must be nice to not include the entire infrastructure of code that is actually doing the heavy lifting as this fantasy that in only 1K you too can do x,y and z.

    1. Re:Really? Only 1k? by Anonymous Coward · · Score: 0

      You could google "Puls by Rrrola" for 256b of "pure DOS code".

    2. Re:Really? Only 1k? by Anonymous Coward · · Score: 0

      WTF are you blabbering about? Just because your code is a bloated mess doesn't mean you can't do plenty in 1K.

    3. Re:Really? Only 1k? by Terrasque · · Score: 1

      Is this list looking better to you? And some of those are even released on multiple platforms :)

      --
      It's The Golden Rule: "He who has the gold makes the rules."
  32. Javascript demos at Pouet.net by Anonymous Coward · · Score: 0

    Demoscene site Pouet.net search finds a few dozens of javascript demos.

    http://pouet.net/prodlist.php?platform[]=JavaScript

  33. Making of the WOLF1K entry by Anonymous Coward · · Score: 1, Interesting

    Here's the making of of WOLF1K and the rainbow characters the Wolfenstein 3D-ish game sans violence in 1k that game #4

  34. IE9? by pandronic · · Score: 1

    Hardly any on those work in IE9.

  35. Raymarching using Distance Fields in 1K by paulo.falcao · · Score: 1

    Raymarching using Distance Fields in 1K Fast on Chrome and Opera http://js1k.com/demo/704

  36. madness...? by islon · · Score: 1

    madness...?? this... is... javascript!!!!