Slashdot Mirror


Javascript Game of Tron In 226 Bytes

Have you upgraded your hardware to play something beefier than 140-byte Tetris? New submitter alokmenghrajani writes with "a detailed view of how we size-optimized a game of Tron to just 226 bytes." It's also optimized for Chrome, and very fast.

115 comments

  1. 1KB Chess For The Sinclair by TheGoodNamesWereGone · · Score: 5, Informative

    1KB Chess for the Sinclair still has that beat.

    1. Re:1KB Chess For The Sinclair by lobiusmoop · · Score: 5, Informative

      Actually it was only 672 bytes - the 1024 byte memory had to include the screen memory also, much like shared video memory today - could take up to 768 of the 1024 bytes for a full 32x24 screen! (the chess game only used an 11-line screen for the board etc)

      And it's even considered by some to be the greatest program ever written.

      --
      "I bless every day that I continue to live, for every day is pure profit."
    2. Re:1KB Chess For The Sinclair by bargainsale · · Score: 1

      There is a Befunge program for chess which is 1.5KB, and plays legally at least. Proof either of the great ingenuity of the human race or of the fact that some people have way too much time on their hands.

      --
      Aberrations have appeared in my destiny prognostication engine!
    3. Re:1KB Chess For The Sinclair by Anonymous Coward · · Score: 3, Interesting

      And what about the 20 MB browser and all other cram below it? I can do a 3D FPS in 0 lines of code by just inserting a DVD into my PS3! Yay for me!

    4. Re:1KB Chess For The Sinclair by Joce640k · · Score: 1

      Just tried it, it works fine in Firefox 13...

      --
      No sig today...
    5. Re:1KB Chess For The Sinclair by hcs_$reboot · · Score: 1

      ie6 also was written within 1k. the thing is, nobody seems surprised.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    6. Re:1KB Chess For The Sinclair by Luckyo · · Score: 1

      It works even on firefox 3.6.x

    7. Re:1KB Chess For The Sinclair by hairyfeet · · Score: 2, Insightful

      Not to mention this is NOT "Tron" this is just a variation on slither. These don't even look like light cycles they are just dots. Lame. And since when do we not count all the overhead of the browser? I'm sure you could get a 5Kb checkers game by using all the existing code in ubuntu or Win 7 but we wouldn't say that it was really a 5Kb checkers game would we?

      --
      ACs don't waste your time replying, your posts are never seen by me.
    8. Re:1KB Chess For The Sinclair by bryan1945 · · Score: 1

      And the "Tron" game I remember had a few other games, to boot.
      Cool project, bad naming.

      --
      Vote monkeys into Congress. They are cheaper and more trustworthy.
    9. Re:1KB Chess For The Sinclair by Anonymous Coward · · Score: 0

      As far as I can tell it's considered to be the greatest by one single person.

    10. Re:1KB Chess For The Sinclair by mcgrew · · Score: 1

      I had that, and it was indeed impressive -- and not just the programming for the game itself. I learned a few tricks studying its code.

      Your linked article, though -- the computer was buggy? A hack and a kludge, perhaps, but impressive kludges and hacks. The only flaws I saw in it were the poorly fitting expansion modules (not needed for the chess game) and the membrane keyboard. But fuggy? What was buggy about it?

      I wrote a two player battle tanks game for it in a couple hundred bytes of machine code, but it was nothing compared to that chess game.

    11. Re:1KB Chess For The Sinclair by mcgrew · · Score: 0

      Uh, mods, the AC was going for "funny". You might want to think before you moderate. See how well that FPS runs if you take the memory out of the computer.

      He does have a good point about the 20 mb browser. A web browser shouldn't take near that much memory. I don't remember the first browser I used, but it came on a single floppy.

    12. Re:1KB Chess For The Sinclair by Anonymous Coward · · Score: 0

      No, I was NOT going for "funny". With enough framework support, a program can be extremely condensed. Demo scene apps can use GPU shaders, sophisticated audio libraries, etc, getting a lot more out of the modest 4K, 2K, or 1K of code than when the IBM PC Jr was around.

      Also, that Javascript Tron game sucks! You can press keys after the all-too-brief "game" is over to increase the "final" score, winning more points in death than one did in life! But maybe there's a religious subtext to this game that I missed...

  2. Black squares... by Anonymous Coward · · Score: 0

    ....are really fast.

  3. Damn. by x0d · · Score: 1

    It's Chrome-only.

    1. Re:Damn. by cynyr · · Score: 1

      I'm running chrome ( Version 19.0.1068.0 (0) ) and i get this nice fast black square....

      --
      All of the above was encrypted with a Quad ROT-13 method. Unauthorized decryption is in violation of the DMCA.
    2. Re:Damn. by Anonymous Coward · · Score: 0

      worked fine in safari. (although control lag wasn't fun)

    3. Re:Damn. by Anonymous Coward · · Score: 1

      Works on Firefox 11 just fine.

    4. Re:Damn. by houstonbofh · · Score: 1

      So I don't know weather to be pissed that it is not standards based and working in Firefox, or pissed because it is slashdotted...

    5. Re:Damn. by hobarrera · · Score: 1

      No it's not. It works fine under firefox. I'd write down what version I'm running, but I can't type that fast.
      You can also look at the code, there's nothing non-standard in it.

    6. Re:Damn. by TheRaven64 · · Score: 4, Informative
      Works fine in Safari. That said, if you press a key other than ijkl it does something random. I assumed wasd would work, and was very confused until I read the instructions. It's also single player, so you basically drive around until you hit your own wall - there's no way of winning. It's more a drawing program with a crappy UI than a game. Making it only 226 bytes of source isn't that impressive, it's basically:
      • Change direction if key is pressed
      • Test if pixel next in that direction is white, if so exit
      • If not, set it to white, set current location to that address
      • Repeat.

      I wouldn't be surprised if you could write the same game in under 226 bytes of Z80 or 6502 assembly, so doing it in a high-level language seems much less impressive.

      --
      I am TheRaven on Soylent News
    7. Re:Damn. by borrrden · · Score: 1

      Works fine for me in Firefox 12.0

    8. Re:Damn. by x0d · · Score: 1

      oh, my mistake. I saw that chrome logo, tried it in opera and it didn't work. I'm also too lazy to open safari just for that.

    9. Re:Damn. by Anonymous Coward · · Score: 1, Interesting

      Under 226? instead of being a critical asshole, that "someone" who sits outside every event and just points, please post your code that does just that. Or, give people a fucking break and realize that pushing boundaries like this is what science, and computer science, is all about. Take off your cynical sunglasses and watch the world become so much more clear. Or not.

    10. Re:Damn. by NemosomeN · · Score: 1

      Saw the Chrome logo, so I tried it in Opera. I'm too lazy to open Safari, so I just assumed it didn't work in Firefox. Sounds logical.

      --
      I hate grammar Nazi's.
    11. Re:Damn. by Ksevio · · Score: 1

      Well it works fine in Opera 12.

    12. Re:Damn. by bvimo · · Score: 1

      and Opera 11.61 (although it is a little fast).

      Version: 11.61
      Build: 1250
      Platform: Linux
      System: x86_64, 3.0.0-16-generic

      --
      In either case, here at Microsoft, we feel standards are important. And we have fun, too. Doug Mahugh, Microsoft
    13. Re:Damn. by dotancohen · · Score: 1

      Works fine in Safari. That said, if you press a key other than ijkl it does something random. I assumed wasd would work, and was very confused until I read the instructions.

      I use Vimperator, you insensitive clod! Even ijkl don't work for me, and my fingers kept trying hjkl anyway!

      --
      It is dangerous to be right when the government is wrong.
    14. Re:Damn. by Anonymous Coward · · Score: 0

      I know snow when I see it, though.

    15. Re:Damn. by Luckyo · · Score: 1

      Firefox 3.6.x (latest 3.6 version) runs it fine.

      Note that code itself suggests that game will not start until you press one of the four control buttons.

    16. Re:Damn. by Anonymous Coward · · Score: 1

      working fine on 19.0.1074.0
      press j k i l

    17. Re:Damn. by antdude · · Score: 1

      It worked OK in my old Mozilla's SeaMonkey v2.0.14 web browser. ;)

      --
      Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
    18. Re:Damn. by dittbub · · Score: 0

      you're right. its like that guy who said he got monkeys to write Shakespeare, he didn't.

    19. Re:Damn. by chrismcb · · Score: 2

      Apparently they don't consider "how to play the game" as part of the game. Hit i,j,k,l (well any key really)

    20. Re:Damn. by tibit · · Score: 0

      1. Computer science has got zilch to do with computers. It's a field of mathematics.

      2. This "tron" program does not push the boundaries of any science.

      3. Neither is it some a software engineering feat.

      It's a hack with some neatness to it, that's about it.

      --
      A successful API design takes a mixture of software design and pedagogy.
    21. Re:Damn. by Anonymous Coward · · Score: 0

      I have to agree. The original Tron game had two players (one the computer), and the object was to make the other person drive into your wall whilst not driving into theirs. This is like, less than half the game. It's like claiming to have written a symphony when you've only written a minuet.

  4. Neat, but by Anonymous Coward · · Score: 1

    keyup instead of keydown makes the game play like junk. Much more apparently unresponsive.

    1. Re:Neat, but by Anonymous Coward · · Score: 0

      Pressing right made it go down. I'm totally not getting the controls. I'd say this is pathetic and not something to crow about.

    2. Re:Neat, but by TheRaven64 · · Score: 1

      The arrow keys that it uses are ijkl. Any other key will make it go in a random direction.

      --
      I am TheRaven on Soylent News
  5. portability by Anonymous Coward · · Score: 1

    Tried it in ie9. It simply doesn't work.

    1. Re:portability by hobarrera · · Score: 4, Interesting

      It works on chrome and firefox. This isn't a portability issue: normally developers add huge amounts of code to support IE. If it needs tweaking for IE, it would probably be 50% larger.

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

      Works fine on Opera 11.61 as well.

    3. Re:portability by Anonymous Coward · · Score: 0

      All you need is Runtime.run

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

      didn't work in my firefox (10.0)

    5. Re:portability by Phroggy · · Score: 1

      Why do people love Chrome so much? It's proprietary software and comes from a company with shoddy business ethics.

      Because it's lightweight and fast, it doesn't pop up with an upgrade notice every two weeks, it has a good standards-compliant rendering engine, and Mozilla desperately needs the competition.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    6. Re:portability by Jorl17 · · Score: 1

      You do know that Chromium in itself is open-source, right?

      --
      Have you heard about SoylentNews?
    7. Re:portability by theweatherelectric · · Score: 1

      Because it's lightweight

      In what sense is Chrome lightweight? Of the five major browsers, Chrome is the second biggest memory consumer and it comes bundled with Flash, which I personally don't have a use for.

    8. Re:portability by ShanghaiBill · · Score: 1

      If it needs tweaking for IE, it would probably be 50% larger.

      The program uses an HTML5 canvas. So it would need a lot more than "tweaking" to work in IE. It would need a completely different implementation.

      But IE 10.0 is supposed to (finally) have canvases.

    9. Re:portability by Darinbob · · Score: 0

      Actually, does NOT work in my firefox.

      But who cares. It just shows that it is highly and amazingly dependent upon the many megabytes of code that it sits on top of. It needs a javascript engine and a browser. You may as well add a byte code that invokes a game of Tron and claim it only needs 1 byte.

    10. Re:portability by tibit · · Score: 1

      And has a half-decent built-in PDF rendered. I classify chrome as about the only useable alternative to Acrobat Reader other than Apple's preview. The various free readers are quite unfinished in many ways, in comparison.

      --
      A successful API design takes a mixture of software design and pedagogy.
    11. Re:portability by hobarrera · · Score: 1

      That's odd. Maybe you should report this to the dev, with your FF version, platform, etc. I played quite a while with FF and it worked fine. The controls are i,j,k,l, and you *may* need to click the black canvas to focus it.

    12. Re:portability by Anonymous Coward · · Score: 0

      Huh. Interesting. Looks like it is in Firefox nightlies now.

      http://hackademix.net/2011/12/07/hulk-want-pdfjs/

    13. Re:portability by pscottdv · · Score: 1

      Huge as compared to 226 bytes.

      --

      this signature has been removed due to a DMCA takedown notice

    14. Re:portability by narcc · · Score: 1

      This is old, but you may want to take a look at Foxit Reader

      I haven't had to suffer Adobe Reader since I found it!

    15. Re:portability by tibit · · Score: 1

      It's not bad perhaps, but I've tried very hard to use it a couple years ago, and quickly had to give up. Their whole operation has had a weird smell to it, as well: it seems perpetually borderline between a domain squatter and a real thing.

      --
      A successful API design takes a mixture of software design and pedagogy.
  6. Controls? by Rinisari · · Score: 1

    I'd love to have another 226 bytes explaining the controls. They don't seem to make much sense...

    1. Re:Controls? by Anonymous Coward · · Score: 3, Informative

      IJKL instead of WASD or arrow keys. It saves space because IJKL is actually in alphabetical order, which makes it a neat modulus away from being the four directions.

  7. 2 player? by Ambitwistor · · Score: 5, Informative

    It's not really a game of Tron without a competing lightcycle. (Without fruit, it's not really a game of Snake either.)

    1. Re:2 player? by Lorkki · · Score: 3, Interesting

      Nor is it really Tetris without tetraminoes or scoring. Not to berate the effort, but it's a lot easier to downsize something when you drop half of the main features.

    2. Re:2 player? by Misagon · · Score: 1

      The light cycles was only a single stage within the Tron arcade game.
      The original "Snake" was Centipede.

      --
      "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
  8. Calling this a game of "Tron" is a stretch by readandburn · · Score: 5, Insightful
    It should be called "Drawing-A-Line-In-A-Tiny-Black-Square-With-Terrible-Controls".

    Come to think of it, that might make a better movie than that last Tron.

    1. Re:Calling this a game of "Tron" is a stretch by Anonymous Coward · · Score: 0

      come to think of it, javascript certainly doesn't make better animation than flash. no wonder the html hype machine has ground to a halt, even on this site.

    2. Re:Calling this a game of "Tron" is a stretch by Anonymous Coward · · Score: 0

      A post by guy-who-is-never-happy-about-movies-that-came-out-recently.

    3. Re:Calling this a game of "Tron" is a stretch by readandburn · · Score: 1
      Let me get this straight. In order to be happy with all movies that came out recently, I had to like Tron?

      I'd love to hear an explanation of that logic.

    4. Re:Calling this a game of "Tron" is a stretch by Anonymous Coward · · Score: 0

      The fellow AC hasn't made so much a logical error as just a foolish one. However, there's a problem with your logic.

      Since you're wanting to "get this straight", yes, it is true that "in order to be happy with all movies that came out recently, you had to like Tron", since Tron is one of those movies.

      To clarify, let A be the set of all recent movies, so Tron is in A. Let P(x) be the statement that you are happy with the movie x. Then the conversation goes like this:

      • You: ~P(Tron)
      • AC: (for all x in A)(~P(x))
      • You: Let me get this straight. (for all x in A)(P(x)) --> P(Tron).

      This final statement is not equivalent to what the AC has suggested. For starters, it is true, whereas the AC's conclusion was, as you suspected, foolish. What you meant was:

      You: Let me get this straight. ~P(Tron) --> (for all x in A)(~P(x)). Or in other words, if I don't like Tron then I don't like any recent movie?

      Or you could go for the contrapositive: If I like any recent movies then Tron has to be one of them?

    5. Re:Calling this a game of "Tron" is a stretch by H0p313ss · · Score: 1

      I don't know if you were aiming for troll, informative or funny. But you had me at contrapositive.

      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
  9. spam gives you points by Seth024 · · Score: 1

    if you keep spamming i,j,k and l, your score keeps going up.

    also, why doesn't it work in firefox??

  10. This again... by zAPPzAPP · · Score: 4, Funny

    226 byte which I am sure include library calls, only runs on top of the multi megabyte of browser code, may use various other resources as well.

    By this standard, I can write Tron in 1 bit.

    1

    There.
    Call it the "Run Tron Bit". It runs on top of a full impletation of Tron.

    1. Re:This again... by sco08y · · Score: 3, Interesting

      226 byte which I am sure include library calls, only runs on top of the multi megabyte of browser code, may use various other resources as well.

      By this standard, I can write Tron in 1 bit.

      1

      There.
      Call it the "Run Tron Bit". It runs on top of a full impletation of Tron.

      Anything that has a display of some sort has library calls to control that display. If you were writing this on an old C-64, it had a comprehensive sprite library that performed collision detection and perfectly synchronized updates, without you doing more than setting a few registers carefully. If you were playing 6502 machine code golf, you could probably write this in half the bytes. Switching to a graphics mode was (IIRC) a single assignment, clearing the screen was a function provided by the BASIC interpreter, and polling for key events was a simple call. Updating the display, naturally, involved writing to a predesignated area of memory. You could even switch back to text mode to print out GAME OVER when you were done.

      In this example, the library calls, which are deliberately designed to be fairly verbose in order to promote readability, chew up much of their byte budget with verbose keywords like onkeyup, getContext, fillRect, etc.

      Also, since you're dealing with complex libraries that provide lots features, code has to turn off some of those features. In this case, they actually generate javascript errors and ignore them. They then have to go through handling key events, handling movement and such, and all with some very cleverly compressed techniques. For instance, they grab the mod of the keyvalue and use that as an index to an array of values to update the player's direction.

    2. Re:This again... by Ksevio · · Score: 2

      The challenge was to write the game in standard javascript - and he did that. It wasn't to include the graphics display drivers (not all that interesting a problem these days). It's not like he included a jquery library (or anything really). Just 221 bytes (in the latest version) that you can post into an html file and run on your computer (no need for internet access either!)

    3. Re:This again... by Menkhaf · · Score: 1

      1

      Hey, that's no one bit. That's a UTF-16 character, which means it is (or rather, may be) a full 32 bits! Back to the drawing board, young lad.

      --
      A proud member of the Onion-in-Hand alliance
    4. Re:This again... by zAPPzAPP · · Score: 2

      That's the source code before I run it through my self made, super optimized compiler.

    5. Re:This again... by Volguus+Zildrohar · · Score: 1

      It runs on top of a full impletation of Tron.

      Fucking bloat!

      --
      When confronted with one problem, some think "I'll use recursion". Now they are confronted with one problem.
    6. Re:This again... by mcgrew · · Score: 1

      Anything that has a display of some sort has library calls to control that display

      Well, IIRC the Sinclair had a 2k rom. That would have to include the display as well as the BASIC language, keyboard detection, read/write to the cassette, etc. The tanks game I wrote for it I wrote in hand-assembled machine code was only a couple hundred bytes, not counting the display code in ROM. It read the keyboard directly, so both players could hold their keys down at the same time without conflicts. I would imagine that the screen rendering from ROM wasn't much bigger than the game itself.

  11. My take... by Anonymous Coward · · Score: 0

    What an awesome game for showing how irritatingly laggy simple keyboard inputs can be in even the most modern of web browser environment. This is the "future"?

  12. This is going to make me sound old but by SDrag0n · · Score: 2

    Our old low-bit graphics games used to do something or have some goal...

    --
    I don't have time to make a sig
  13. Even Shorter by BrokenCube · · Score: 3, Interesting

    The current version of the code (on the linked site) is only 221 bytes long - and I've had a quick play with it and it can be reduced further to 219 bytes by swapping out the boolean ANDs "&&" for bitwise ANDs "&" twice.

    1. Re:Even Shorter by alokmenghrajani · · Score: 2

      your are right, thanks! I'll update the code & give you credits.

    2. Re:Even Shorter by alokmenghrajani · · Score: 1

      your are right, thanks! I'll update the code & give you credits.

      i meant to write you are right. Thanks!

    3. Re:Even Shorter by BrokenCube · · Score: 1

      your are right, thanks! I'll update the code & give you credits.

      i meant to write you are right. Thanks!

      Seems someone else got there first, as it's been attributed to "skrounge" - oh well :(

  14. Same thing in x86 asm by Juippi · · Score: 4, Informative

    This was fun, because I got pretty much the same thing down to 56 bytes in x86 assembly some 15 years ago. I remember the best entry in the competition I wrote it for being around 48 bytes or so; I missed at least one trick for setting the graphics segment more efficiently, and also something related to either collision handling or keyboard input, don't remember which.
    In any case, this is possibly the right version of the code. Should compile with NASM, and is even playable in Dosbox with arrow keys if you turn the emulation speed as low as it can go.

    1. Re:Same thing in x86 asm by Anonymous Coward · · Score: 0

      Impressive! That means Assembler is only about 4 times better than JavaScript!

    2. Re:Same thing in x86 asm by PCM2 · · Score: 1

      56 bytes of assembly language source code? I highly doubt it.

      --
      Breakfast served all day!
    3. Re:Same thing in x86 asm by Mr+Z · · Score: 2

      There's only 56 bytes that the computer has to read from somewhere to have a runnable program. In the case of Javascript, since there's no compiled bytecode, you have to download and run from the source. For assembly language, I think it's fair to measure the binary that results from assembling, since it's pretty much a 1:1 translation at that level.

      Under DOS, I believe you could actually key the whole program's machine code in with Alt-Keypad sequences using "copy con: foo.com" as long as your program didn't have a ^Z in it. Would you count the source code length then as the number of keystrokes on the keyboard then, or the number of bytes produced? (And if so, are we going to count all the shift keypresses for typing curly braces and parentheses in the Javascript program? Ha.)

      Take a look at that 672 byte chess program someone mentioned earlier. You don't hear anyone talking about the size of the source code or even the fact that to create the program image requires a machine with 3K. The resulting program image that the machine has to load (mixture of BASIC and machine code) takes 672 bytes of RAM.

    4. Re:Same thing in x86 asm by alokmenghrajani · · Score: 1

      Are you referring to hugi (http://www.hugi.scene.org/compo/compoold.htm) ? I believe the x86 size optimization people were doing in the 80s and 90s required a different mindset. You needed to really understand the OS environment & memory layout (e.g. putting DOS in graphics mode using a single byte). When optimizing javascript you focus on the javascript language (e.g. what happens when you do things like undefined xor 1). But overall you can't really compare assembly to javascript. Some things in javascript (e.g. regexp) are almost free, while defining a function requires you to write "function(){}" when it's only 2 instructions in assembly.

  15. And how much supporting code? by davidbrit2 · · Score: 4, Insightful

    How many megabytes of supporting code are necessary to run those 226 bytes?

    1. Re:And how much supporting code? by smoothnorman · · Score: 1

      Yes, this is exactly my point too. As an limiting argument, let's say my window manager had some-sort of graphics interface with more bells and whistles than emacs. "ooo look! i wrote a script that resulted in a full Donkeykong game in less than 32 characters!!" of course, that was one of the features of the fancy fictitious graphics interface that there are a number of example games that could be started with the equivalent of "run('donkkong')"

    2. Re:And how much supporting code? by Ambitwistor · · Score: 1

      Yeah, seriously. In Python it would be just 11 bytes, 'import tron'.

    3. Re:And how much supporting code? by toriver · · Score: 1

      If you cook a meal, do you say that you and the store clerk and the transport driver and the farmer and the butcher and the miller and the service technician at the electricity company cooked the meal?

    4. Re:And how much supporting code? by davidbrit2 · · Score: 1

      I don't expect them to engineer and construct the computer system from scratch, but claiming it's 226 bytes and ignoring the mountains of libraries and APIs being relied upon throughout the OS and web browser is a bit like ordering from McDonald's and saying you "made dinner".

    5. Re:And how much supporting code? by trev.norris · · Score: 1

      If you're going that far, then how many more lines of code were required to write the kernel of your operating system?

      You've just stuck your head down a rabbit hole, and the rabbit ripped your head off.

    6. Re:And how much supporting code? by davidbrit2 · · Score: 1

      Invalid straw-man exception.

      I don't think the byte size is important for "golf" purposes unless you count everything down to the bare metal. If they can do Tron in 226 bytes of x86 machine code, then I'll take note. Otherwise the size is only meaningful from a practical standpoint, e.g. how much more disk space and RAM will be necessary to use this program.

      I can put "win.com" in autoexec.bat, but that doesn't mean I've implemented Windows 3.1 in 7 bytes.

    7. Re:And how much supporting code? by trev.norris · · Score: 1

      No straw-man here. You're original comment was just all inclusive. All you said was "supporting code [...] necessary to run". So you would have to include all supporting code. If you had excluded OS level instructions, then I wouldn't have had a problem. Because if Tron had been written in Java, you would also have to include all the source for the JVM. Now, a C level program that compiled down to machine code, then cool. But you didn't specify the scope of "supporting code".

  16. I read that as by Anonymous Coward · · Score: 0

    Javascript Game of Thrones in 226 bytes. Impressive.

    1. Re:I read that as by game+kid · · Score: 1

      Given the size of that book, I'm pretty sure a Javascript Game of Thrones would need like 226 disk partitions.

      --
      You can hold down the "B" button for continuous firing.
  17. Not particularly impressed by these by Anonymous Coward · · Score: 1

    1) It's not really the game, something that kind of maybe looks sort of like the game
    2) doesn't really even have the right functionality
    3) is only a small bit of logic

    Tron();

    Tron in 7 bytes in javascript.

  18. not tron by eyenot · · Score: 5, Funny

    I think there's a difference between Tron and Suicidal Etch-A-Sketch

    --
    "Stratigraphically the origin of agriculture and thermonuclear destruction will appear essentially simultaneous" -- Lee
  19. Etch-A-Sketch by tepples · · Score: 4, Funny

    Suicidal Etch-A-Sketch

    Please leave Governor Romney out of this.

  20. I set the interval to 50... by bartoku · · Score: 2

    Now it is like I am playing in Matrix time and I rock!

  21. Best viewed in... by Anonymous Coward · · Score: 0

    I would just like to express how much I hate anything that promotes using one browser over another.
    It's like people have forgot the lessons of the past, or are just totally oblivious to them.

  22. Horrifically Invalid Markup by Anonymous Coward · · Score: 0

    It is also horrific from an html point of view. No head, no title, no html, no doctype, no quotes around attributes, no closing of body or canvas tags. That is even skipping nicities like xml prolog and doctype headers. This is more like a bunch of crappy text which happens to trick some browsers into thinking they are html and script. The amazing part is not that this emulates a tron-like animation in a small footprint (with poor latency on the controls I should add), but that it renders anything at all without the browser giving up.

  23. Google: Please bring an end to DirectX! by Anonymous Coward · · Score: 0

    If more games were created for Google Chrome, or some other type of cross-platform offering, and good games at that, perhaps we could finally be free from the Smeagol of multimedia: DirectX.

  24. Re:A whole web page? Put it in the URI. by Anonymous Coward · · Score: 0

    Could you post this in one of those text sharing sites? Copying this didn't seem to work.

  25. You mean "Nibbles" or "Worm"? by nemui-chan · · Score: 1

    I was super excited when I found out someone had done this for tron... Until I realized it was actually the old qbasic nibbles or worm game. This is neat and all, but its not tron. Its not even the tron light cycle game since you play by yourself. Oh well.

  26. Useless to me... by EmagGeek · · Score: 1

    ... 226 bytes is cool and all, but is useless to me since it doesn't work on my platform. I would gladly accept it taking, say, even 15,000 bytes if it actually worked. It's not as if I can't afford the RAM.

  27. I've seen this done with 120 characters - one line by Trax3001BBS · · Score: 1

    I started with a TRS-80 III, cassette drive storage. There was a magazine,
    "80 Micro" which held a contest, who could write the best one line program.

    There was a trick to get more characters (an extra 10 or so) in one line I forget
    now the total length but think around 120 characters (bytes) on one line.

    This was done in Basic using Peeks and Pokes to keep them short.

    Lot's of entries; most being this Java Tron cycle type, be it Tron, skiing downhill
    or racing; just something controllable going forwards until it hits something.

  28. 3D multiplayer Tron in 4kb by Anonymous Coward · · Score: 0

    I made this with C++ a while ago:
    http://www.pouet.net/prod.php?which=33971
    Used crinkler to pack it down...

  29. Stupid? by balbord · · Score: 1

    Has all of /. gone stupid?
    Sure it's a lame name for the "project", and it's barely playable, and doesn't work in all browsers... but is a freaking awesome piece of code and all I read here is childish whining. Go back to facebook.

    What happened to /.?

    --
    "If I have been able to see so far, It is because I went out and bought a damn binoculars" - Ze da Esquina