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.

27 of 131 comments (clear)

  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. 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)

  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 WrongSizeGlass · · Score: 5, Funny

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

  4. 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.

  5. 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!
  6. 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/

  7. 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 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.

    2. 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

  8. 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.
  9. 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/

  10. 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.

  11. 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"

  12. 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.

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

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

  14. 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..
  15. 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/

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

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

    --
    www.RacquetUp.org - Helping Detroit Youth
  17. 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.

  18. 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
  19. 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?
  20. 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?