Slashdot Mirror


Tetris In 140 Bytes

mikejuk writes "Is it possible to write a JavaScript program in no more than a tweet's length? A website called 140byt.es says it is and has an implementation of Tetris to prove it. Ok, it only has two types of block — hence its title "Binary Tetris" — and there's no rotate, but it works. The blocks fall down the screen and you steer them into place. You can try it out by playing the demo. Of course the real fun is in figuring out how it works and there is lots of help on the site — so if you're bored how about the 140 character challenge?"

215 comments

  1. Binary Tetris by Anonymous Coward · · Score: 2, Funny

    Binary Tetris?

    http://a.fsdn.com/sd/topics/programming_64.png

    1. Re:Binary Tetris by cupantae · · Score: 3, Informative

      Binary Tetris is based on dominoes instead of tetrominoes and is called Dis.

      --
      --
  2. Nostalgia ... by WrongSizeGlass · · Score: 5, Insightful

    It reminds me of the old days when code was efficient and had to fit onto small discs and into limited RAM and/or ROM. The original Mac ROMs were 128k, and all the apps had to run in 128k of RAM. It was amazing what could be done when it just had to fit.

    1. Re:Nostalgia ... by arth1 · · Score: 5, Interesting

      It reminds me of the old days when code was efficient and had to fit onto small discs and into limited RAM and/or ROM. The original Mac ROMs were 128k, and all the apps had to run in 128k of RAM. It was amazing what could be done when it just had to fit.

      Get off my lawn. The ZX-80 and -81 had 1 kB, and there were plenty of games for them. Then there were other computers, all with limited memory.
      I'm sure there are lots of people here except yours truly who have written a variant of SNAKE.

    2. Re:Nostalgia ... by peragrin · · Score: 5, Funny

      However the code itself is 140 bytes, the number of libraries required to operate it is at 10 gigabytes.

      --
      i thought once I was found, but it was only a dream.
    3. Re:Nostalgia ... by __aamdvq1432 · · Score: 2

      Reminds me of those very same days and renews my joy that we now have the freedom to use "inefficient," mnemonically useful names for variables and functions along with coding conventions that give the next programmer at least a remote chance to understand and support the code without great genius.

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

      The point here is code that fits in a tweet.

      Perhaps it takes 10 gigs worth of source, if you took the liberty of lumping entire swaths of lib files which might only provide 1 function, or 1 constant even. Your exaggeration is to no point.

      It is true that authored source has no bearing on actual code used to create something... but that's why it''s much fairer to point out the size of a static binary.... where this would be quite small if run in a terminal, and quite big if you counted an entire browser as "size".

    5. Re:Nostalgia ... by _merlin · · Score: 2

      That's not even true. The original Mac had 64kB ROM, and 28kB of it was taken up by the QuickDraw graphics library. The 512Ke and Plus had a massive 128kB ROM. The ROM size went up to 256kB with the SE and II, then doubled again to 512kB with the IIci. It eventually got up to 1MB with the Quadra. The biggest classic Mac ROMs were 2MB in the Quadra AV and "blackbird" PowerBook 500 series.

    6. Re:Nostalgia ... by Tarsir · · Score: 1

      128K? What a bunch of bloated crapware. I was working on code that had to fit within 28K last year

    7. Re:Nostalgia ... by TheLink · · Score: 1

      So what? If enough computers meet the requirements then it's fine in my book. After all my computer requires electricity to work.

      In fact if it's cross platform on multiple browsers it's better in some ways than those intros/demos that only ran on one specific platform (I won't be surprised if some of those were even fussier and wouldn't work on some variants of the same platform).

      --
    8. Re:Nostalgia ... by thesh0ck · · Score: 5, Informative

      The fact is.. only the math is 140bytes. If you view the source and scroll down you see there is way more than that to actually make it work. Including javascript for controlling the game and displaying the blocks. It is in fact 1361 bytes.

    9. Re:Nostalgia ... by Anonymous Coward · · Score: 5, Insightful

      Oh, well, in that case, allow me to introduce you to my 4 character Tetris program.

      t();

      (That's a function call to an external library that does all the other shit needed)

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

      Sorry, this is Slashdot. I am unable to tell if you are being sarcastic or you are one of the members of this community who feel writing undocumented code that required documentation is a golden calf that keeps the plebs out of the wondrous art of coding.

    11. Re:Nostalgia ... by MisterMidi · · Score: 4, Funny

      +1 insightful. We could make an entire OS in 140 bytes this way.

    12. Re:Nostalgia ... by hal2814 · · Score: 5, Funny

      A tweet? I'm not familiar with that metric. Maybe you could convert it to something more standard like Libraries of Congress.

    13. Re:Nostalgia ... by Bigbutt · · Score: 0

      2kb actually. And you could get a 16k memory module.

      [John]

      --
      Shit better not happen!
    14. Re:Nostalgia ... by Short+Circuit · · Score: 1

      Has that been added as a Golf builtin yet?

    15. Re:Nostalgia ... by Anonymous Coward · · Score: 5, Informative

      The european versions had just 1k (two 2114 chips of 1k x 4 bit)

    16. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      AFAIK there was 64KB of ROM.

    17. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      That's why every GOOD assembly programmer made sure to comment liberally and keep detailed design notes so that they COULD figure out what the code did months later or for the next programmer to come along.

    18. Re:Nostalgia ... by cshark · · Score: 1

      [script type="snobbery"] Looking at whole thing though, it feels kind of inefficient to render the whole board every time you move a piece around, and it's certainly not salable. I mean, what if there were more controls, or a bigger board? This thing would fall apart completely. [/script]

      --

      This signature has Super Cow Powers

    19. Re:Nostalgia ... by tibit · · Score: 2

      Seconded. I still deal with eZ8, a Harvard architecture platform that has 2kb of RAM and 16kb of code EEPROM on the particular chip I'm using. And then there's XMOS XS1 with 64kb of RAM that has to fit all the code and data for up to 8 threads of execution, running at an aggregate 500MIPS. Yet you can code some pretty amazing stuff on both.

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

      Trust me, 1kB. And yes, I had a 128kb doorstop before my speccy.

    21. Re:Nostalgia ... by mrmeval · · Score: 1

      I remember writing code for a 1541 floppy that had to fit in a sector if I recall correctly. I never figured out how to daisy chain that as some did and I never went farther with programming.

      I'd have no issue with dense code in that context if the libraries would be available with any standard browser install. I would take exception with how javascript pulls in code over the network. Most languages are not very good if you can't use an external library at compile or run time but requiring any library to be installed just to run that code is a cheat.

      More restrictive rules. It has to run in 140 bytes only. So this is what I've got. ;) I can't code for life, love, nor money now so this is borrowed.

      <script type="text/javascript">
      document.write("Hello Slashdot")
      document.write("TACOS RULE")
      document.write("+1 Informative")
      </script>

      --
      I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
    22. Re:Nostalgia ... by Anonymous Coward · · Score: 5, Funny

      in javascript you don't need to end the last statement on a line with a semicolon, so you could reduce it to t()

    23. Re:Nostalgia ... by brantondaveperson · · Score: 1

      Get into microprocessor coding if you want to relive those old days. You can have your 512bytes of RAM and eat it too!

    24. Re:Nostalgia ... by Dogtanian · · Score: 5, Informative

      Trust me, 1kB.

      To clarify this, you're right that the original versions of the ZX80 and ZX81 both had 1KB onboard.

      However, the US version of the ZX81 (the Timex Sinclair 1000) shipped with 2KB onboard, which is probably what the GP was thinking of.

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
    25. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      I would have modded you up for only the last bit: that it's more meaningful to compare the size of the static binary. It reminds me of the article where the author gets a linux binary to the absolute minimum size by hiding code in the elf header itself. Posting as AC to keep other mods in this thread.

    26. Re:Nostalgia ... by RobertLTux · · Score: 3, Informative

      that would be roughly 2.3 lines of a card catalog card (assumes 12 point type and a 3X5 card)

      --
      Any person using FTFY or editing my postings agrees to a US$50.00 charge
    27. Re:Nostalgia ... by Anonymous Coward · · Score: 1

      Here is the reference (I'm the same AC/mod as parent): http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

    28. Re:Nostalgia ... by hairyfeet · · Score: 4, Interesting

      Wow I thought we VIC-20 owners had it bad with our lousy 5Kb, man just the thought there was somebody out there that could out cheap old Jack Tramiel is kind of mind blowing in and of itself.

      As for TFA just imagine hoe much insane power we would have if they still made OSes and apps like every byte counted. Not to condone piracy or anything but if one were to try out the Tiny series like Tiny XP or Tiny 7 you'd find that with careful stripping one can make a modern Windows that damned near runs on the original WinXP specs and is snappy as hell. MSFT really needs to hire that guy as his Tiny series frankly stomps both the Win Embedded and WinFLP version quite badly. i guess that little hacker knows how to slim down their OS better than they do.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    29. Re:Nostalgia ... by AmberBlackCat · · Score: 1

      Yes, I remember when the latest Fedora Core CD didn't tell me I'm unable to install because the computer only has half a GB of RAM.

    30. Re:Nostalgia ... by Sneeka2 · · Score: 1

      i guess that little hacker has a much greater interest in slimming down their OS than they do.

      FTFY

      --
      Bitten Apples are still better than dirty Windows...
    31. Re:Nostalgia ... by hairyfeet · · Score: 0

      Actually its more likely they simply have too many PHBs getting their two cents worth in. if you haven't read it there is a blog out there on the "evolution" of the Vista start button. When you see how many meetings and committees and bullshit went into what should have been a simple button you realize that the courts not splitting up MSFT was really a curse not a blessing. If they could have been split into OS, Business, Mobile and Gaming I bet MSFT would be doing a hell of a lot better than they are doing now. There is just too much bureaucratic BS to do things ubersleek and cutting edge.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    32. Re:Nostalgia ... by Zadaz · · Score: 3, Interesting

      Nibble magazine (an Apple magazine from 1980-1992) had a coding contest every month. The rules: Maximum 2 lines of Apple BASIC. IT was probably my favorite part of the magazine. There were some amazing submissions.

    33. Re:Nostalgia ... by TheMathemagician · · Score: 1

      Yes the UK version of the ZX-81 only had 1K RAM but that included the screen and the system variables. The screen was a maximum of 32 chars x 24 lines (= 3/4 K) but when a line was blank it was stored internally as a single byte. I think the system variables were 128 bytes but could be wrong on that. Oh and of course the program itself had to be stored in that RAM too so there were weird tricks like using PI-PI for 0 or PI/PI for 1 because PI was an inbuilt constant and used 1 byte (so those expressions were 3 bytes total) whereas raw numbers took 5 bytes. There were some surprisingly good games produced nevertheless so I look forward to seeing what people can squeeze out of 140 bytes.

    34. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      Excuse me sir, but I own a chip plant in China and I need to pay my bills. If you start producing efficient code how can I sell more hardware with your no-value-added new releases?

    35. Re:Nostalgia ... by arth1 · · Score: 3, Informative

      You can still download those.
      There are also annual "one-liner" contests for various languages, which have been around for at least a generation.
      perl is probably the winner in one-liners. Including useful utilities like (all way smaller than 144 bytes):
      perl -00pe0 filename
      ... which will strip all superfluous blank lines from a file, leaving just single blank lines.
      Or, to find all primes between 5000 and 5100:
      seq 5000 5100 | perl -lne 'print if (1x$_) !~ /^1?$|^(11+?)\1+$/''
      Or, a simple working web server - actually useful to pull files from one machine to another:
      perl -MIO::All -e 'io(":8080")->fork->accept->(sub {$_[0] < io(-x $1 ? "./$1 |" : $1) if /^GET \/(.*) /})'

      There's also this DOS/Windows gem:
      X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

      Save it as eicar.com and your antivirus software should pick it up.
      And you can execute it too (it's harmless, of course). A 69 byte binary executable that only contains ASCII characters.

      All in all, the article submission isn't all that impressive.

    36. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      I believe its 1.5 standard size Babylonian cuneiform tablets, Per ISO (alpha) 0.02 (code name: Hammurabi)

    37. Re:Nostalgia ... by Anubis+IV · · Score: 2

      From what I can tell, the standard measure for Libraries of Congress (LoC) is 10TB of data, which was apparently estimated based only on the textual content of the physical materials stored, and without any consideration for the petabytes of digital storage that the Library claims to have.

      Based on that, you could express the length of a Tweet as roughly 1.27e-11 LoC in size.

    38. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      And if you're going to do that, might as well go with .kkrieger, which is 96k and implements a first person shooter ( http://www.theprodukkt.com/kkrieger )

    39. Re:Nostalgia ... by White+Flame · · Score: 1

      The problem is that all of these hand-rolled optimization hacks defined the boundaries & capabilities of the program, instead of the other way around. In fact, the board size in this tetris implementation is 5x6 is because that encroaches on the 32 bit max you get with shifting operators in JS. If you built an OS based on these principles, you could not come anywhere near what today's OS expectations are, just like this author could not do a regular-sized tetris playfield with his source-code saving tricks.

      Once you start making real demands of computers, your software cannot use its environment and neat optimized alignments to guide what it will do; it needs to follow the actual features humans need it to do, regardless of implementation issues.

      Granted, if somebody spent years (and years) hand-tuning assembly implementations of everything in some major operating system, it'd get faster, but it would also be nigh impossible to add any truly new features to the next version. Plus it would still have the same complexity, because we need OSes to do a lot of things.

      I'm an old 6502 hacker from the home computer days myself, having spent probably a few solid man-years manually counting clock cycles, but let's step back and honestly look at reality.

    40. Re:Nostalgia ... by Anonymous Coward · · Score: 0

      Hey guys I just made an OS in 13 bytes.

      C:\> autoexec.bat

    41. Re:Nostalgia ... by DemonGenius · · Score: 1

      perl is probably the winner in one-liners.

      Wrong.

    42. Re:Nostalgia ... by Bigbutt · · Score: 1

      Yea, I'm in the US so I was going by my experience when I owned one back in 1980 or so.

      [John]

      --
      Shit better not happen!
    43. Re:Nostalgia ... by ockegheim · · Score: 1

      Though I recall that once the 128k Mac had the System and Microsoft Word on it, there was barely any room left for a document.

      --
      I’m old enough to remember 16K of memory being described as “whopping”
  3. Read the source code - love the licence.txt by Dark$ide · · Score: 5, Interesting
    Take a look at the source code

    You'll love the non-restrictive EULA.

    --

    Sigs. We don't need no steenking sigs.

    1. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 0

      EPIC!

    2. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 3, Funny

      Everyone is permitted to copy and distribute verbatim or modified
        copies of this license document, and changing it is allowed as long
        as the name is changed.

      Why should i have to change the name? I feel that is overly and unnecessarly restrictive.
      I should have the right not to change the name if i don't want to.
      This source code is useless to me.

    3. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 5, Informative

      You'll love the non-restrictive EULA.

      It's called WTFPL.

    4. Re:Read the source code - love the licence.txt by just_a_monkey · · Score: 1

      Bold. He assumes full liability for any and all damages that his code does. Implied, since there is no clause that says he doesn't. If that's not necessary, why do all other licenses have that part?

      --
      How inappropriate to call this planet Earth, when clearly it is Ocean.
    5. Re:Read the source code - love the licence.txt by Provocateur · · Score: 2

      But it's version 2? I wonder how bad version 1 was!

      --
      WARNING: Smartphones have side effects--most of them undocumented.
    6. Re:Read the source code - love the licence.txt by edxwelch · · Score: 1

      funny, I don't see that one on the officially approved list at opensource.org

    7. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 0

      Because in reality, the reliant code for the Date and parsInt are much much longer.

      In reality, you're fucking retarded.
      Please tell me you're not serious.

      Also, Javascript != Java, get that into your thick skull.

    8. Re:Read the source code - love the licence.txt by cshark · · Score: 1

      You're right. Javascript is not Java, but the thing is bigger than just that one function. If you read the bit about what's going on with the code, or view the source of the page, you'll see that it's about six times larger, all told.

      --

      This signature has Super Cow Powers

    9. Re:Read the source code - love the licence.txt by icebraining · · Score: 1

      It doesn't have to be approved to be considered open source by the OSI, just comply with the definition.

      It's on the FSF licenses list, though.

    10. Re:Read the source code - love the licence.txt by icebraining · · Score: 1

      Nitpick: It's not an EULA, just a copyright license.

      EULA means End-User license agreement, while this license doesn't apply to end users, just to people re-distributing the software.

    11. Re:Read the source code - love the licence.txt by icebraining · · Score: 3, Informative

      I'm not sure if it's necessary or not, but in this particular case, it's a Tetris game, not a remote controller for sharks with freakin' lasers.

    12. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 0

      If you distribute in the EU, you have that liability anyway, since licenses can't override the law here.

    13. Re:Read the source code - love the licence.txt by kelemvor4 · · Score: 1

      DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

      Seriously a great idea. I'm sure the GPL crowd will step in momentarily to tell everyone why it's a bad one, though.

    14. Re:Read the source code - love the licence.txt by roman_mir · · Score: 3, Funny

      Well, version 2 is 'binary Tetris', so I just assume that version 1 was 'unary Tetris'.

    15. Re:Read the source code - love the licence.txt by Datamonstar · · Score: 3, Funny

      Not gonna read that. I'll just do what the fuck I want to!

      --
      The eternal struggle of good vs. evil begins within one's self.
    16. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 0

      DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

      Seriously a great idea. I'm sure the GPL crowd will step in momentarily to tell everyone why it's a bad one, though.

      It's bad in the sense it allows you to give a restrictive license to a modified version of the software, similarly to BSD's license. Some people want to protect others' freedom, and these people won't use that license.

    17. Re:Read the source code - love the licence.txt by koinu · · Score: 1

      You won't be liable for mistakes and errors except you had the intention to do something evil (sabotage etc).

    18. Re:Read the source code - love the licence.txt by Spugglefink · · Score: 1

      Seriously a great idea. I'm sure the GPL crowd will step in momentarily to tell everyone why it's a bad one, though.

      That reminds me of when I bought a Kinekt gear ring. It's totally me, but it sucks as delivered, because it has all kinds of sharp points. I rigged up a solution involving a Dremel tool and a drill press to grind the little gears in motion to remove all the little pokey things, and made it mine. I was thinking about posting the technique somewhere, and then I started to talk myself out of it, because I might be able to profit from this valuable intellectual property one day, and maybe I should patent the idea and guard it closely.

      A friend, on hearing this, said, "What? You're going to go into business modifying these rings? Really?"

      Indeed. My technique for altering Kinekt gear rings is a perfect candidate for the DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE. I really should release a lot more of, or maybe all of my stuff that way. What? I'm going to start a business? Right. Who really cares anyway?

      The same could very well be said for most of, if not everything I've released under the GPL over the years. What do I really care if somebody takes my stuff and does whatever the fuck they want with it? It's not like I was going to make money or get famous or something if they hadn't taken my stuff.

      Also, that version of Tetris is about the most fun I've ever had playing the game. It's easy, and very much my speed. I was on a great roll until it accelerated wildly out of control and killed me. Alas.

    19. Re:Read the source code - love the licence.txt by DaVince21 · · Score: 1

      That's alright. Because with this license, you can DO WHAT THE FUCK YOU WANT.

      --
      I am not devoid of humor.
    20. Re:Read the source code - love the licence.txt by PlatyPaul · · Score: 2

      I take it you missed the bonus level, then. Shame.

      --
      Misery loves company. Online misery loves unsuspecting random strangers.
    21. Re:Read the source code - love the licence.txt by Anonymous Coward · · Score: 0

      In this case it is Javascript. If it somehow causes damage then that is the fault of the Javascript interpreter. His code is no more likely to cause any damage than your comment is.

  4. Somewhat Misleading by iONiUM · · Score: 5, Informative

    Not to diminish their accomplishment, because this is very cool, but the 140 byte implementation is the base logic, it's not the actual printing or keyboard handling. Maybe that's nitpicking, but technically you can't just copy/paste that code and have the game, so I find the summary misleading.

    1. Re:Somewhat Misleading by melikamp · · Score: 2

      Indeed. The actual source has about 955 characters, which is not that impressive for a game so gimped.

    2. Re:Somewhat Misleading by anonymov · · Score: 4, Informative

      Almost kilobyte? Yep, not very impressive considering what people build in 1 kB of Javascript.

      Not to mention all the cool things people stuff in 512 byte intros for demo parties.

    3. Re:Somewhat Misleading by Anonymous Coward · · Score: 0

      Yes, the summary is misleading, but we all knew at some level that it had to be. After all, Javascript is not binary code and requires a 10MB+ web browser to make it work. But it is a cute implementation and I like how it harkens back to the second half of the 1970's, when all sorts of interesting games were being made and yet most fit easily in a 4KB cartridge.

    4. Re:Somewhat Misleading by Anonymous Coward · · Score: 0

      So, is it possible to write Tetris in 140 bytes of JavaScript? No, not even when almost all of the code you're executing doesn't count because it's part of the web browser or operating system.

    5. Re:Somewhat Misleading by hydrofix · · Score: 5, Informative

      Here's actually a full Tetris with sound in 1016 characters!

    6. Re:Somewhat Misleading by cupantae · · Score: 1

      In case anyone else tries this in Firefox, try it in Chrome and it will work.
      As a devoted fan, I don't know what that says about my beloved Firefox. Is it possible that this was just written for Chrome's javascript implementation and doesn't necessarily mean one is better than the other?

      --
      --
    7. Re:Somewhat Misleading by Anonymous Coward · · Score: 1

      This worked fine in Firefox for me. Perhaps you should check if any of your beloved extensions are interfering by running Firefox's own safe mode

    8. Re:Somewhat Misleading by mastakuno · · Score: 1

      It's somewhat misleading but it should still be considered a clever 140 byte implementation of a tetris engine. I say fair play to the author of the code. Especially for the fantastic license.txt.

    9. Re:Somewhat Misleading by _0xd0ad · · Score: 1

      To be fair, that has some extra fluff as well - it's well over 1024 bytes if you count the HTML template. Although, since it doesn't need a <title> or the canvas element, you can reduce it somewhat further. If you take out the sound, you can reduce it even further.

      936 bytes of raw javascript. Paste it into the address bar:

      javascript:'.<script>M=Math;C=12;f=[];A=\'charCodeAt\';S=\'slice\';for(P=0;P<96;){k="/SN;__/NK;OL/QN;__/OL;NK4L@@_C4_G@OL4SO@__4QN@OL3NB%3F_G3_K%3FOL/QN;__/SK;__4OL@__4LC@_G4LC@_G4_C@_G"[A](P++);for(j=0;k<95&&j<1e4;){v=M.max(-1e4,M.min(1e4,1e6*M.sin(j*M.pow(2,k/C)/695)))/M.exp(j++/5e3)}}for(e=i=252;i--;)f[i]=i%25C&&i<240%3F(i+1)%25C%3Fr=0:\'%E2%96%88<br>\':\'%E2%96%88\';t=p=4;function d(c){for(q=p+[13,14,26,25][r%254],i=1;i<99;q+=((i*=2)==8%3F[9,-37,-9,37]:[1,C,-1,-C])[r%254])if(\'36cqrtx\'[A](t)&i)if(-c){if(f[q])return 1}else f[q]=c}function m(e){Q=[-1,0,1,C][e%3Fe.keyCode-37:3]||0;d(0);p+=Q;r+=!Q;s=d(1);if(s)p-=Q,r-=!Q;d(\'%E2%96%92\');document.body.innerHTML=f.join(\'\').replace(/0/g,\'%E2%96%91\');return s}onkeydown=m;o=function(){P=P%2596+3;if(m()){t=~~(7*M.random()),p=r=4;e=d(1)%3F1e9:e;for(y=0;y<240;)if(f[S](y,y+=C).join().indexOf(\'0\')<0)f=f[S](0,C).concat(f[S](0,y-C),f[S](y))}setTimeout(o,e*=0.997)};o()</script>'

  5. Not really... by Anonymous Coward · · Score: 0

    var t =
    function(a,b,c,d,e){return d+=c,e=a|b<<d,d<0|a&b<<d&&(a=e=parseInt((a|b<<c).toString(d=32).replace(/v/,""),d),b=new Date%2?1:3),[a,b,d,e]}
     
    // Controller and Display
     
    var out = document.getElementById("output");
     
    var board = 0,
        block = 3,
        position = 32,
        display;
     
    function update(offset){
     
      var txt = "",
        result = t(board,block,position, offset);
     
      board = result[0];
      block = result[1]
      position = result[2]
      display = result[3];
     
      display = ( 1<<30 | + display ).toString(2);
     
      for(var i=1; i<31;i++){
        txt += display[i] == "1" ? "#" : ".";
        if(i%5 == 0) txt+= "<br>";
      }
     
      out.innerHTML = txt;
    }
     
    update(0);
     
    onkeydown = function(e){
     
      var offset = 0;
     
      switch (e.keyCode){
        case 37: offset = 1; break;
        case 39: offset = -1; break;
        case 40: offset = -5; break;
      }
     
      update(offset);
    }
     
    var speed = 1000;
     
    function loop(){
      update(-5);
      setTimeout(loop, speed-=5);
    }
     
    loop();

    ... is more than 140 bytes.

  6. It is still requiring a virtual machine. by Anonymous Coward · · Score: 1

    To have the program run, you have to have a javascript interpreter. That is cheating.

    1. Re:It is still requiring a virtual machine. by History's+Coming+To · · Score: 4, Funny

      To write that post you had to have a bunch of silicon doped to recreate basic logic gates, a kernal to pass it instructions, an OS to let you interact with the kernal, a browser to connect it to a worldwide network and so on. This is cheating. Real Slashdotters use a butterfly.

      --
      Please consider this account deleted, I just can't be bothered with the spam anymore.
    2. Re:It is still requiring a virtual machine. by History's+Coming+To · · Score: 2

      Hey, if there's open source comedy out there why bother bootstrapping your own gags?

      --
      Please consider this account deleted, I just can't be bothered with the spam anymore.
    3. Re:It is still requiring a virtual machine. by Anonymous Coward · · Score: 0

      To write that post you had to have a bunch of silicon doped to recreate basic logic gates, a kernal to pass it instructions, an OS to let you interact with the kernal, a browser to connect it to a worldwide network and so on. This is cheating. Real Slashdotters use a butterfly.

      ... and a kernel, in all honesty.

    4. Re:It is still requiring a virtual machine. by The+Askylist · · Score: 1

      Not if you're using a Commodore Pet....

      http://en.wikipedia.org/wiki/KERNAL

    5. Re:It is still requiring a virtual machine. by Anonymous Coward · · Score: 0

      I thought it was a 'kernel'..... but I may be wrong

  7. Cool but buggy by Anonymous Coward · · Score: 1

    If one of the 2-blocks goes to far to the side, it will wrap around. If one of the 1-blocks goes to far to the side... I'm not really sure what happens. Something odd at any rate. You can use it to tunnel them to the bottom, though.

    I'm not really sure what could be cut down to make space for the bounds-checking, though. Maybe the constraints are just too tight.

    1. Re:Cool but buggy by Anonymous Coward · · Score: 0

      It's kinda funny. With some effort you can even get those double blocks to float in the second layer.

  8. Dear /. Overlords by TubeSteak · · Score: 5, Informative

    so if your bored

    Dear /. Overlords,

    Would it be too much trouble to plug some type of grammar and spelling module into the slash-code?
    Not for us, the /. users; for you, the /. editors. I believe that in this wonderful age of computing, we wouldn't
    begrudge you guys a little help before you hit "submit."

    Sincerely,
    You're

    --
    [Fuck Beta]
    o0t!
    1. Re:Dear /. Overlords by Nerdfest · · Score: 5, Funny

      Your being to picky. People care less about grammar these days ten most other things. Irregardless, there doing the best they can

    2. Re:Dear /. Overlords by Jorl17 · · Score: 0

      EPIC!

      --
      Have you heard about SoylentNews?
    3. Re:Dear /. Overlords by Anonymous Coward · · Score: 0

      You mispelled grammer.

    4. Re:Dear /. Overlords by just_a_monkey · · Score: 0

      Seconded. How does one even come up with the idea to work as a writer if you can't even write very simple English correctly? (Or, from the other perspective, how does one get hired as a writer without having even very basic writing skills?)

      --
      How inappropriate to call this planet Earth, when clearly it is Ocean.
    5. Re:Dear /. Overlords by Riventree · · Score: 0

      +1 The difference between there they're and their, it's and its, etc., isn't rocket science. They teach it (successfully) in elementary school.

    6. Re:Dear /. Overlords by John+Hasler · · Score: 1

      how does one get hired as a writer without having even very basic writing skills?

      By being hired by a manager who also has a degree in journalism.

      --
      Warning: this article may contain humor, sarcasm, parody, and perhaps even irony. Read at your own risk.
    7. Re:Dear /. Overlords by Anonymous Coward · · Score: 0

      That was awesomely cromulent. Slashdot's post-monkeys are such loosers.

    8. Re:Dear /. Overlords by snowgirl · · Score: 1

      Your being to picky. People care less about grammar these days ten most other things. Irregardless, there doing the best they can

      Its not "ten" dumbasd. Its "then"!

      --
      WARNING! This girl exceeds the MAXIMUM SAFE standards established by the FDA for BRATTINESS
    9. Re:Dear /. Overlords by kelemvor4 · · Score: 4, Insightful

      Your being to picky. People care less about grammar these days ten most other things. Irregardless, there doing the best they can

      Was that as painful for you to write as it was for me to read?

    10. Re:Dear /. Overlords by 6Yankee · · Score: 1

      Saved two bytes, though...

    11. Re:Dear /. Overlords by Anonymous Coward · · Score: 0

      Huh? "bored" and "board" are both 5 bytes in ASCII (or UTF-8, or ISO8859-whatever).

      Also, if my board, what?

    12. Re:Dear /. Overlords by Tyrannosaur · · Score: 2

      I had to read it about 3 times...

    13. Re:Dear /. Overlords by Anonymous Coward · · Score: 0

      How about an automated -1/Illiterate down-mod for misuse of your/you're, their/there/they're, its/it's, and so on?

    14. Re:Dear /. Overlords by L4t3r4lu5 · · Score: 1

      Your being to picky. People could care less about grammar these days ten most other things. Irregardless, there doing the best they can

      FTFY. I think.

      --
      Finally had enough. Come see us over at https://soylentnews.org/
    15. Re:Dear /. Overlords by just_a_monkey · · Score: 1

      Heh. I read a job ad the other day that had "Requirements: journalism degree or equivalent". How jolly inclusive in this day and age, when anyone who has finished primary school has "equivalent".

      --
      How inappropriate to call this planet Earth, when clearly it is Ocean.
  9. Not 140 bytes by sakdoctor · · Score: 3, Insightful

    The function requires an animation loop and event handler otherwise it does nothing. After that, it's way more than 140 bytes.

    1. Re:Not 140 bytes by IgnitusBoyone · · Score: 1

      Agreed,

      Its not that impressive to generate some base logic and strip down your variable names to cram it in to a small character space. Personally, I was more impressed with.

      http://games.slashdot.org/story/04/04/15/1239203/first-person-shooter---under-100kbs-of-code

      --
      Momento Mori
    2. Re:Not 140 bytes by Gavin+Scott · · Score: 4, Insightful

      Yes, it's about 816 characters in total. This is complete fail compared to the kind of stuff that's done for the IOCCC competition. The 140 byte function they wrote implements once tiny part of the whole thing, and looking at it suggests that there really aren't going to be many interesting programs possible in 140 bytes of javascript.

      If you want to see actually impressive tiny programs written in 2K of C code, like the guy who wrote an entire BASIC interpreter one year and then followed it up with a compiler for the same language the next year, then check out the IOCCC sinners page:

      http://www.ioccc.org/years.html

      G.

    3. Re:Not 140 bytes by Gavin+Scott · · Score: 4, Funny

      Was supposed to be "winners" of course, but then "sinners" might well be the more appropriate term anyway...

      G.

    4. Re:Not 140 bytes by equex · · Score: 0

      meh i was gonna mod you funny but had a twitch (major hangover) and rated you overrated instead :) i thought the same thing essentially!

      --
      Can I light a sig ?
    5. Re:Not 140 bytes by Scott+Wood · · Score: 1

      One of my favorites is banks in 1998... a flight simulator in 2256 bytes (shaped like a plane, of course). And that's raw libX11, no web browser...

  10. So if your bored by Anonymous Coward · · Score: 0

    My bored what!?!

  11. Re:Obilg Bill Gates (if he ever said it) reference by rbpOne · · Score: 0

    Ofcourse Bill Gates never said such a thing.

  12. Still not as good as: by lobiusmoop · · Score: 5, Interesting
    --
    "I bless every day that I continue to live, for every day is pure profit."
    1. Re:Still not as good as: by pdh11 · · Score: 3, Informative

      Nor this http://survex.com/~olly/rheolism/: real Tetris in one line of BBC BASIC, 255 bytes after tokenisation. All the shapes are stored in one 32-bit constant. It's just amazing.

      Peter

    2. Re:Still not as good as: by rastos1 · · Score: 1

      Here is another Tetris in 256 bytes.

  13. Not 140 Bytes by Anonymous Coward · · Score: 0

    Only the model part of the model-view-controller program is 140 bytes.

  14. is it possible to write javascript in 140 chars? by lkcl · · Score: 1

    null;

  15. More! by slasho81 · · Score: 3, Insightful

    Now, this is proper Slashdot material. More of this, please!

  16. Oh, we used to DREAM of having 140 bytes by beamdriver · · Score: 1, Funny
    When I was young, we had to code an entire web browser in 8 12 bit words using only the three switches on the front panel.

    And we were grateful to have it.

  17. Tetris in 6 bytes by Anonymous Coward · · Score: 1

    Tetris

  18. Not really Tetris, Not really an implementation by hydrofix · · Score: 1

    If you look at the site, it is obvious that this is neither Tetris nor an implementation of Tetris. It is just a part of the game that when given the current layout in certain encoding, the current user input and some other state variables can tell you what is the next state. All of this is meaningless unless you know what should you do with this state information. Crucially, included is neither the drivers to read user input or the method to render the game board for display.

    So yes, this is one part of an implementation of a Tetris. But then again, any given block of code less than 140 characters in length from any full implementation has also a claim for being a part of an implementation of "Tetris". So I therefore proclaim that I have beaten them by my even shorter "implementation", which simply consists of the letter u (a part of crucial JavaScript keywords like "function" and "return") for it has an equally valid claim for an "implementation" of "Tetris" as this function, in some perverted regard ;).

  19. In Soviet Rus. LICENSE wastes you! by JCPM · · Score: 2

    But if they include the LICENSE, it's much bigger than 140 bytes, some as >200 times the size of the program. The LICENSE is the only wasteful thing that did exist on the Earth.

    JCPM: to erase the LICENSE and then this program is much smaller, adjusted to 140 bytes, otherwise, it will be lying me.

  20. It doesn't help that... by Anonymous Coward · · Score: 0

    ... Javascript was built to be human-readable.

    If those commands were shorter, you could probably fit the rest of the code in a small space too.
    You could probably write a wrapper layer to make all those commands 1 letter, well, most.
    Can you ever make "return" smaller? I tried a few ways, but never managed to do it so gave up.

  21. Optimization by hcs_$reboot · · Score: 1

    Ok. But considering the trend in using whatever memory and resources are available, the currently available Tetrises would rather take 140 MB. Many programmers just build ridiculously inefficient and inelegant algorithms, just because the amount of resources let them do so.

    --
    Slashdot, fix the reply notifications... You won't get away with it...
    1. Re:Optimization by mysidia · · Score: 1

      By the time you add all the bytes used by the Web Browser and OS required to run this software, it's probably larger than 140MB.

      A 140 byte bootable Tetris floppy image would be much more interesting

  22. Hmm I could write Tetris... by hcs_$reboot · · Score: 1

    ...in only 6 bytes.

    --
    Slashdot, fix the reply notifications... You won't get away with it...
  23. I call bullshit... by macraig · · Score: 1

    ... because they're pretending that the many tens of thousands of lines of code in the JavaScript interpreter don't count. They do, because those 140 bytes are useless without it.

    1. Re:I call bullshit... by anonymov · · Score: 1

      ... because they're pretending that the many tens of thousands of lines of code in the OS and libraries don't count ...
      ... because they're pretending that the many tens of thousands of lines of HDL code in the processor don't count ...

      True demoscener builds his own CPU out of transistors and resistors. Some suggest that using logic gates ICs is acceptable, but they're wimps.

    2. Re:I call bullshit... by jo_ham · · Score: 1

      At some point you have to draw the line where the program stops and the interpreter begins. The OS is another example.

      I think I'd cut it off at the point where everything becomes generic, so the interpreter is a general device that can be used for other programs, not just this game.

    3. Re:I call bullshit... by macraig · · Score: 1, Offtopic

      I just knew that some contrary doofus looking for a pissing contest would trot out a comment like yours. Why don't I see the exact same foolishness from you repeated in reply to the other comments that made exactly the same point I did? Congratulations, you win the argument on a laughable Relativist technicality that no one but you takes seriously.

    4. Re:I call bullshit... by macraig · · Score: 1

      *Compiled* code has always been where that line was drawn, so an interpreter counts as part of the code. The operating system and BIOS are on the other side of that line because they truly are "generic", and since programs can be written to be platform independent.

  24. A tweet is longer than that by Hentes · · Score: 2

    Twitter uses utf-8, so the size of a tweet is 1120 bytes.

    1. Re:A tweet is longer than that by tiffany352 · · Score: 1

      UTF-8 is 8 BITS, not 8 BYTES. The largest per-character encoding of Unicode as far as I know is utf-32, 32 bits or 4 bytes.

    2. Re:A tweet is longer than that by Anonymous Coward · · Score: 0

      each character is 8 bytes? what implementation of utf-8 is this?

    3. Re:A tweet is longer than that by Anonymous Coward · · Score: 0

      No, it would have to use UCS-4 to make it that big. UTF-8 makes the characters >1 byte only for those that require it.

  25. 140 bytes and a couple of bugs by Roujo · · Score: 1

    Try pressing left until you go off the screen. Wooo, secret level! =D

  26. Your bored by Higgins_Boson · · Score: 2

    figuring out how it works and there is lots of help on the site — so if your bored how about the 140 character challenge?

    If my WHAT is bored? I don't get this line.

    1. Re:Your bored by Anonymous Coward · · Score: 0

      The real question is if my bored what?

  27. pong in 50 bytes of x86 assembler by bzipitidoo · · Score: 1

    Some time ago, I participated in a contest to see who could write the shortest Pong game in x86 assembler. Of course entries used BIOS calls and ran on the text screen. The winner's entry was 50 bytes. Got about 30 entries in all, averaging somewhere around 75 bytes.

    --
    Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
  28. useful for SMS Low-Orbit Canyon DDoS. by JCPM · · Score: 1

    Each one of the mobil phones will receive an unauthorized hidden 140-byte SMS Javascript message that will used for Distributed Denial of Service against mobil telephone operators as by example, the monopolied ATandT in USofA.

    JCPM: useful as screensaver of SMS Low-Orbit Canyon DDoS, and the consumer will be playing gratis to this game Tetris.

  29. Fucken by Anonymous Coward · · Score: 2, Informative

    proofread you're submissions. Sheesh, youse merkins all y'all illiterate, er wat?

  30. I have a shorter Tetris implementation by jez9999 · · Score: 4, Funny

    Here is my Tetris implementation:

    a()

    However, it only works on custom Javascript interpreters which have a global a() function that implements a full game of Tetris.

    1. Re:I have a shorter Tetris implementation by Anonymous Coward · · Score: 0

      .

      It works on my custom programming interpreter that uses '.' as the Tetris function.

      See also: HQ9+

    2. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      That is the first thing I thought when I looked at the code. The answer to the question "Is it possible to write a JavaScript program in no more than a tweet's length?" is yes, but that tetris-like demo is not proof. It is not even a real game since there are no victory conditions or score. It has no usefulness besides a demo, and since they hid code in external functions it's usefulness as a demonstration is insubstantial.

      Hello World is enough proof. Hello World is no more then a tweets length, and is actually useful to people learning javascript. The only thing 140 byte tetris will be useful for, I think, is collecting ad views for it's authors website.

    3. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      Why on earth does a game need victory conditions? There are a vast number of games (including, of course, Tetris) that don't have them. There are a huge number that don't have score either. And there are plenty of games that don't really have either.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    4. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      Tetris uses loss avoidance victory condition mechanics - you lose when the screen fills up with blocks. If you are unfamiliar with basic game mechanics you should read the wikipedia page on victory conditions. Also if you are unfamiliar with the basic elements as to what constitutes a game then perhaps you should read the wikipedia page on games too. Quote wikipedia "Key components of games are goals, rules, challenge, and interaction." Victory (or loss) conditions are goals, and a score system provides challenge. The demo has rules and interaction but lacks the other 2 key components that define a game. With only 2 of 4 components, it is not really a game.

      There is no game that exists that lacks these four basic elements, because without these 4 elements it is not a game.

    5. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      We're taking Wikipedia as the only definition of what a game is now?

      I guess my response ought to be that dictionary.reference.com defines a game as "1. an amusement or pastime", and that therefore your definition is invalid.

      I could list games that lack some or all of those elements, and you'd probably just define them as non-games, so what's the point? I disagree with the definition of loss avoidance as a victory condition as well - because you never reach a state where you have attained the victory condition. The one feature that I'd personally say is [b]absolutely[/b] mandatory for a game from your list of four elements is interaction. But then, since we've decided that Wikipedia is the arbiter of all things game-related, I'd have to see the entry on zero-player games and query whether, for example, Progress Quest can be counted as a game. Probably also rules, although there are plenty of games where the rules are emergent from a very small initial set (Nomic and its derivatives, which [b]also[/b] typically start with no goals, and may continue without them pretty much through to the end in some cases).

      You've certainly moved the goalposts, of course. Victory conditions are not the only type of goals, and score systems are not the only type of challenge. As a result you're not even actually disagreeing with my original point - you don't need victory conditions or score systems even to fulfill your definition of a game as including goals, rules, challenge and interaction.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    6. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      You could list games that lack some or all of those elements, not because the games actually lack those elements, but rather because you lack knowledge of what those elements are. Did you even read the page on game mechanics? Victory conditions are a game mechanic. Goals are a type of victory condition. Loss avoidance is a type of victory condition. If your only objective is loss avoidance then your only goal is to not lose. Tetris can be played multiplayer using the exact same victory conditions as are in the single player game. The last person to trigger the loss avoidance algorithm in a pvp tetris match is the victor, the only added rule in tetris pvp is that each row cleared by a player adds one row to the bottom of every other player. You are flat out wrong if you insist that tetris has no victory conditions, and if you have to ask why a game needs victory conditions then you are obviously not a trained professional, nor are you qualified to make informed comments about the subject.

      Tetris has victory conditions. Those victory conditions are a specific subset knows in the industry as "Loss Avoidance". Do you know there is a professional game development industry with standard terminology and established practices? There are universities that have programs that award a degree in game development, and what they will teach you in those universities is summarised in that wikipedia article on game mechanics. If wikipedia is not credible enough for you there is a large body of academia on the subject available elsewhere, perhaps you should read some of it.

    7. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      You're moving the goalposts again rather than addressing the points. Yes, of course multiplayer Tetris has a victory condition. The change from single player Tetris to multiplayer Tetris involves adding such a victory condition. This makes your argument "Tetris has a victory condition because if you add a victory condition to it it has a victory condition" which is, unfortunately, not a very good argument. There are universities that have programs that award degrees including modules on basic logic; perhaps you could consider one.

      There are whole classes of games that thrive on not having victory conditions. What good would an MMORPG be that had victory conditions that allowed you to reach a state where you'd 'won' the game? At that point there's a real option of stopping playing. So you don't provide victory conditions; the game remains open ended and unending.

      You say that the Wikipedia page lists loss avoidance as a victory condition, but unfortunately you haven't read it properly; it refers to that specifically in a competitive game such as your Tetris example. The victory condition isn't avoiding loss, it's avoiding loss while the other players fail to do so. The victory condition is being the last player standing, which is a perfectly valid victory condition. At this point you have won the game. The game is over. You are victorious. The same does not apply to single-player Tetris. Avoiding loss there does not make you the victor. You have never won the game, because the moment your attention is distracted you promptly lose. It's still a perfect example of a game that neither has nor needs victory conditions.

      You seem to have failed to understand what that section of the Wikipedia article is actually describing. Let me quote it for you.

      These mechanics control how a player wins the game.

      Their emphasis, not mine, though if they hadn't done it, I'd have had to. When we're talking about video games, not all games have the concept of winning. Ironically, since you grouped the two together as necessary features of games, it's quite often score-focused games that don't have such a concept; a perfect player could continue playing forever in theory, but in the real world a player will always lose.

      Let's look at another quote from this article that you put so much faith in:

      Other examples include the availability of a sandbox mode without predefined goals nor progression

      Worth mentioning because you still wrongly insist that games must have predefined goals. Any sandbox game will tend not to, allowing the player to set their own goals should they wish to. Stepping out of the realm of video games, any well-run RPG (to my mind) is unlikely to have hard and fast goals; it's also unlikely to have victory conditions.

      Is this a good time to point out that in the past I've written and received payment for a number of games, both pen-and-paper RPGs and computer games? Some of those had victory conditions. Some of them had scoring. Not all of them had either, though. So yes, I have experience on the subject, in a more practical way than a theoretical university course. I've also played plenty of games, and I can recognise a victory condition when I see one. Unfortunately, it appears, you can't.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    8. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      This conversation reminds me of when I used to work as a web developer. Just because a client has used web sites before (and maybe even designed a website in front page) does not mean they know the correct technical terminology or industry standards.

      Multiplayer Tetris has the same victory condition as single player Tetris. You would know this is you have ever written an implementation of Tetris. The game ends when the last person loses. The book "Game Development Essentials" by Jeannie Novak has a great chapter on the subject and specifically mentions Tetris in reference to victory conditions. In that book it states that Tetris does not have any explicit victory conditions, but that instead it has an explicit loss condition (which is a sub-type of victory condition). The book also mentions the fact that Tetris contains several types of implicit victory conditions that revolve around scoring.

      Loss avoidance is a victory condition. You are winning until the moment that you lose. Haven't you ever seen a football game where one side is up in points and thus winning, until the very end when they lose, because the other team makes a comeback and score more points before the time runs out? It is a very common question "who is winning?". A team can be winning the match for several rounds, but lose the game in the end. Same principal applies to Tetris. A Tetris player can win several rounds, but lose the game when they trigger the loss avoidance victory condition.

      Any well run rpg consists of individual modules that do indeed have goals and victory conditions. Individual questlines in a MMO RPG have goals and victory conditions. Instanced PvP has explicit goals and victory conditions. Open world PvP has the implicit goal of not dying to other players. PvE has goals and victory conditions as well. You can lose a match in a Warcraft arena. You can fail an escort or defend mission.

      If you are using RPGs as examples of whole classes of games that have no victory conditions then you are wrong again. I do not care what you have done, your words directly contradict the large body of established works by industry veterans who have actually produced material they are not embarrassed to mention by name. When I refer to a a victory condition I am using the industry accepted terminology. I was correct when I said you would not even know a victory condition when you see one... but don't let facts get in the way of your overinflated sense of self worth.

    9. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      There is an article on gamasutra entitled "Basic Game Theory: Core Elements" by Gregory Gauthreaux. He makes an adamant attempt to explain the concepts in laymans terms, because apparently it is hard to grasp for people unfamiliar with the industry.

      "There are four elements that all games must have... They must be fun [challenge], they must have structure [rules], they must have a goal [victory conditions], and they must have at least one player [interaction]... Depending on whom you talk with, some elements can be added to the list but never will these elements be omitted."

      Even the so called 'zero player games' such as core wars or progress quest have these elements. Progress quest has a host of complex rules, the challenge arises from accruing score, the goal is to reach the maximum progress, and the interaction while limited to the player creating a character and keeping the client running, is clearly present. The only thing that differs between PQ and conventional MMOs like WoW is the range of interaction available to users. Wow has a host of complex rules, the challenge arises from gaining renown and gear to raise your gearscore or whatever , the goal is to reach the maximum level and finish all the campaign storyline quests, and the interaction comes from creating a character and running instanced raids and arenas.

      The difference between a MMO and traditional game is not a lack of victory conditions, but rather a different development and release cycle. The Zelda RPG franchise releases a new self contained game every few years, each containing distinct challenges, rules, interactions and victory conditions,.A MMO in that same time will release expansion content equivalent to a whole new game, with each expansion containing distinct new challenges, rules, interactions and victory conditions. MMO games do end, the same way that traditional games like skyrim ends. Endgame mmo characters are left with instanced content that contains explicit goals, and player defined implicit goals, much the same way that the player in skyrim who has finished the story and won the game can decide to still play and run that same dungeon they have already beaten over and over again and again.

    10. Re:I have a shorter Tetris implementation by Anonymous Coward · · Score: 0

      I would like to point out the fact that most single player Tetris implementations have a defined end. In the original, version 3.12 for DOS, the game ends when the player reaches level 30 or clears 200 lines. Most versions created since the first have ended the game after a set number of lines, a time limit, or a maximum level cap. In Tetris DS, standard mode ends at level 20 or after 200 lines.

      So... even if you refuse to accept the fact that a loss avoidance is a victory condition, your argument that "tetris has no victory conditions" is wrong.

    11. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      I wouldn't go as far as to say 'most' (difficult to tell, given just how many Tetris variants and clones there are out there), but yes, some Tetris implementations have a defined end with victory conditions. Some offer multiple game modes, in which some have victory conditions and some don't.

      So even though I correctly assert that loss avoidance is not a victory condition in single-player continuous play Tetris, I happily agree that when you introduce victory conditions into it in other ways (through the multiplayer game or through setting arbitrary points at which the game ends) it has victory conditions. It was, however, pretty clear that this wasn't what we were discussing, or the point would have been raised earlier and I'd have agreed with it. So yes, I would be wrong to claim that all versions of Tetris have no victory conditions, and I wholeheartedly agree that some versions and some game modes of it do. But to be specific, single-player continuous-play Tetris (ie. with no artificially imposed game end) does not have victory conditions, because there is no victory state for the game.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    12. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      I'm editing this post to be less confrontational. When I feel that someone's being an ass to me, I tend to be an ass right back at them, and that tends to escalate into some sort of competition. Which you, of course, would lose, as I'm more of an ass than you are. :P

      I agree entirely that most games should have fun, structure, goals and players. While there's some interesting work on the fringes of ludology to probe at exactly how much you can reduce the latter three elements, those are the basic elements. I largely agree with Gauthreaux on this. The issue, of course, is with the attempt to draw equivalencies with the terms in square brackets, which he does not do. For example, to claim that 'goal' is equivalent to 'victory condition'. Which, of course, it isn't, as we've already seen. You still haven't addressed the fact that there is no victory condition in an endless game like some versions of Tetris and other similar puzzle games. Your only response has been to continuously claim that since there are versions which have victory conditions, all versions have victory conditions, which clearly isn't the case. A game either has a victory condition, in which case the ultimate goal is to reach that victory condition, or it doesn't, in which case it tends to have an unending series of other goals, typically more abstract. The goals in an unending game of Tetris primarily revolve around reaching the next level, or clearing a certain number of rows. But reaching each goal doesn't win the game - instead it just sets the next goal, which should be of increased difficulty.

      Since we're quoting game definitions, why not go back to Wittgenstein from that Wikipedia article:

      Wittgenstein demonstrated that the elements of games, such as play, rules, and competition, all fail to adequately define what games are. Wittgenstein concluded that people apply the term game to a range of disparate human activities that bear to one another only what one might call family resemblances.

      I think that sums up the problem quite nicely. You can try to provide a neat all-encompassing definition of what a game is, but the reality is that the edges of that definition will remain somewhat fuzzy.

      I'll disagree with you in more specific and less adversarial ways on zero-player games. I think you're overreaching to make Progress Quest fit into those four categories. Interaction that's limited to starting the game up is not interaction in any real sense, in my opinion. There's also no real challenge, as score increases monotonically over time without anything that could be described as challenge. And as far as I know, though it's a long time since I've 'played', there's no 'maximum progress' except as defined by the limitations of the coding, and it's debatable as to whether that should be counted as a goal in the game itself, though it is set as a goal by players of certain games, with the top-rank goal being to play the game until it crashes due to coding errors. I'd say that Progress Quest doesn't meet most of those definitions, and I'd also say that as a result it isn't really a game. It's a parody of a game, and the nature of that parody is exactly that; to remove the genuine game-like features from a game while keeping the domain model. Sort of the reverse of gamification.

      Core Wars is a different story. It isn't a zero-player game. The gameplay in Core Wars isn't in running the game engine (which looks like a zero-player game). It's in developing the redcode programs that fight in the game engine. There's no equivalent to that in Progress Quest, but in Core Wars it provides interaction and challenge. Each battle or set of battles has victory conditions. It's really a multiplayer or solitaire game. Though again, the victory conditions become a little less well-defined in solitaire mode; how do you, the player, 'win' when you're pitting two of your own creations against each other? Another of those fuzzy edges...

      I take

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    13. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      Multiplayer Tetris does not have the same victory condition as single player Tetris, though. The condition for being the winner in two player Tetris is to still be playing when the other player has lost. At this point you have won the game. You are the victor, and nothing that then happens will change this fact. Some implementations will stop gameplay immediately at that point and throw up a "Player One Wins!" message. Others may allow the player to continue. But in both cases, that player is the winner of the multiplayer game.

      We can extrapolate that for any number of players. In an n-player game of multiplayer Tetris, the victory condition is to still be playing when (n-1) players have lost. In a two-player game, one player must lose. In a three-player game, two must lose. In a 32-player networked monstrosity of a Tetris game, 31 players must lose before the last man standing is declared the winner. I take it you see the problem when we apply this to one player - the victory condition becomes that 0 players have lost. The game becomes 'press start to win'. Clearly that's not the case - you wouldn't accept a Tetris game that when you press start immediately throws up a message saying "Player One Wins!" and stops - so this victory condition isn't valid.

      I'd like to deliver a bit of a killer blow to your argument now. You reference "Game Development Essentials" by Jeannie Novak. I'd like to quote to you from the top of page 185.

      Many puzzle games have no victory conditions. In Tetris, the game just gets increasingly difficult until the player decides to stop.

      Your industry professionals don't agree with you. They agree with me. She also mentions other types of game that don't have explicit victory conditions, but it's hard to get more specific than that statement. Many puzzle games have no victory conditions - exactly as I've claimed all along. She even cites the very same example as I did.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    14. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      >You still haven't addressed the fact that there is no victory condition in an endless game like some versions of Tetris and other similar puzzle games. Your only response has been to continuously claim that since there are versions which have victory conditions, all versions have victory conditions, which clearly isn't the case.

      That is not at all what is happening. In the official standard Tetris rules the game ends after 200 lines, 30 levels, or, when the player's screen fills up with blocks. Just because some versions exist that changed the first two victory conditions does not mean that the third victory condition does not still exist. There are no versions of Tetris that do not end. Every version of Tetris has a piece of logic that exists to test for when the game ends. In the industry this segment of the game program that is a conditional statement that determines when the program changes a game's play state or triggers a response sequence is known in as a "victory condition". It is a conditional statement that governs victory. Defeat is the inverse of victory so they are lumped together, albeit in the same segment of the program, in the same section of the rulebook, or in the same category of an article. This is what I mean when I say that Tetris has "victory conditions". There are "conditions" in Tetris that arise and can be tested for, and those conditions triggers a "victory" or the inverse of such. "Victory" (or non-victory) in this context refers to the conclusion of a segment of the game process and the start of another.

      >Most traditional games that have a victory condition end when that victory condition is reached, and any players who reached it have won.

      A game of Football has a victory condition, but Football leagues also have seasons, with separate victory conditions. A team can win 3 games in a row, but not win the season championship. An army can win the battle but lose the war, because the battle has victory conditions while the war has differing victory conditions. Sand box games are a collection of encounters each with differing victory conditions. Each expansion in a MMO functions as a new campaign or 'season' .

      >I think you're overreaching to make Progress Quest fit into those four categories. Interaction that's limited to starting the game up is not interaction in any real sense, in my opinion.

      And here you are doing exactly what you accused me of doing. I could point out every one of those four design elements in any game you named, and you'd probably just refuse to acknowledge that the game contains those elements, so what's the point? Your opinion is wrong. Progress Quest is a game, with almost as much interaction as slot machines. If progress quest had a pay to play version that randomly awarded real-life cash the games would be almost exactly the same. Are you going to now claim that the slots are not a real game?

      The game of Slot has rules (reel chances and payout tables), they have a goal (get the correct symbols to line up when the game ends), they have interaction (you start the game, by putting in a coin and pulling the lever), and they have challenge (try to win money).

      >You can try to provide a neat all-encompassing definition of what a game is, but the reality is that the edges of that definition will remain somewhat fuzzy.

      I go by the industry standard definition of what a game is, in the context of the video game industry, as taught in curriculum throughout accredited universities. You could claim that a game is really more or less then what the definition I go by is, you can claim that victory conditions are not what I say they are, but your words contradict everything I have ever seen on the subject.

    15. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      You're still trying to fudge things, I see? The first two victory conditions you describe exist in some modes of some versions of Tetris and yes, you can see them as victory conditions. The third thing you list is not a victory condition. It is a loss condition. This is why the industry expert you cited in one of your other replies says that such games have no victory conditions.

      You made the appeal to authority; your authorities do not back you up. This is where you admit you were wrong, or demonstrate you are delusional. These are the only two options you have. Sorry.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    16. Re:I have a shorter Tetris implementation by xhrit · · Score: 1

      Consider this: In a multiplayer game any condition that triggered victory for one player would by default also trigger defeat for every other player. Inversely any condition that triggers defeat for one player may trigger victory for one or more players. Thus any "Victory Condition" can also function as a "Defeat Condition" and vice versa.

      Now consider the following points.

      1) The game of Tetris has a state that ends in player defeat.
      2) Victory conditions can trigger player defeat.
      3) Victory conditions can be used trigger player defeat in Tetris.

      Statement number 1 stands as a fact no one is disputing.
      Statement 2 should have been adequately demonstrated above.
      If statement 2 is true, then statement 3 is also true.
      If statement 3 is true then it is only logical to conclude that Tetris has victory conditions, or the inverse equivalent, which are for all intents and purposes identical except in name.

      Unless you are going to argue that victory conditions can under no circumstance trigger defeat for any player, there is no reason to continue this conversation. This is the point where I say you are arguing semantics just being an ass, and cease all further discourse with you. Have a pleasant day.

    17. Re:I have a shorter Tetris implementation by Anonymous Coward · · Score: 0

      That makes your argument "Tetris has no victory conditions because if you make a version that removes all victory conditions then it has no victory conditions" which is, unfortunately, not a very good argument. I guess that makes you a hypocrite as well as an asshole.

    18. Re:I have a shorter Tetris implementation by Anonymous Coward · · Score: 0

      Your original statement "Tetris does not have victory conditions" is not true, because as you have clearly stated, some versions of Tetris do in fact have victory conditions. Any attempt to continue to support the statement "Tetris does not have victory conditions" by changing your argument to "Single player Tetris does not have victory conditions" or "Some versions of Tetris do not have victory conditions" is what is known as "moving the goal posts", and is what you have accused the person you are arguing with of doing.

      Congratulations, you are now a hypocrite as well as an asshole.

    19. Re:I have a shorter Tetris implementation by iapetus · · Score: 1

      Aw. It's kind of endearing when idiots try to use logic.

      Let's look at where the flaws in your argument are, shall we? From your list of statements:

      1. This is irrelevant to your argument, as you don't use it in your later reasoning. You're trying to associate your argument with an obvious fact to strengthen it by its proximity to that fact, I guess.
      2. This is a very incomplete statement - deliberately so to conceal the dishonesty in your approach. A fuller version of it is as follows:
      "In some games, one player reaching a victory condition can trigger defeat conditions for other players."
      3. This is a restating of what you're trying and failing to demonstrate.

      The modified version of statement 2 is something we agree on, and we've already discussed some examples.

      Your initial paragraph, though, contains a heinous logical flaw. What you're claiming is this: there are some victory conditions that also trigger defeat. Therefore, all victory conditions trigger defeat. That's a doozy of a logical fallacy. It's the "Some birds are green. A blackbird is a bird. Therefore a blackbird is green." argument.

      Your claim that statement 2 leads to statement three is also utterly unsupported. Even if we accepted your definition of statement 2 rather than the accurate one, it's fundamentally the same logical problem; you're making an unwarranted generalisation from the fact that some defeat conditions can trigger a victory to a claim that all defeat conditions can trigger a victory, which isn't true.

      You're trying to argue that black is white.

      I'm also going to bring this up in every response to you from now on, because you're too much of a coward to address it. In support of your claim that all games must have victory conditions, you cited "Game Development Essentials" by Jeannie Novak. However, on page 185 of this book, Jeannie Novak writes:

      Many puzzle games have no victory conditions. In Tetris, the game just gets increasingly difficult until the player decides to stop.

      So, your options:

      1) You are wrong. I am right. Games can have no victory conditions, and industry experts give Tetris as an example of such a game.
      2) You claim to be right, and also accuse the industry experts you earlier said should be trusted are lying hypocritical asses who know nothing about games.

      I'll give you a clue. It's option one. And if you had any intellectual integrity you'd apologise for your mistake and stop digging.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    20. Re:I have a shorter Tetris implementation by Anonymous Coward · · Score: 0

      The only true version of Tetris didn't have a defined end. When you got to level 10, it didn't get any faster or harder; you played until you lost. If you overflowed the 32,767 point limit of its signed integer, you played from -32,768 back toward 0.

  31. Geesh... by taoboy · · Score: 4, Informative

    #!/usr/bin/perl

    use StupidShitIveWritten::Tetris(tetris);

    tetris;

  32. see the same programmers do it on an atari 2600 by Danathar · · Score: 1

    Let's have a competition where we pull out some old hardware (like the 2600) and THEN see what they can do.

    We all know the old guys did it. What about today's younger coders? Can they program something fun and useful in 4K using the programming languages available a 2600?

    1. Re:see the same programmers do it on an atari 2600 by swb · · Score: 1

      Do you mean to limit them by programming languages or the internal resources on a 2600 system?

      Theoretically, newer languages and better tool chains might possibly result in something as good or better than what 2600 developers produced at the time. There may have been coding techniques that were known or attempted but just proved prohibitive with the tool chains of the the 2600 era.

      On the other hand, 2600 developers weren't distracted with the web and were razor-focused hand -coded and -debugged assembler.

    2. Re:see the same programmers do it on an atari 2600 by Dogtanian · · Score: 1

      Can they program something fun and useful in 4K using the programming languages available a 2600?

      Bear in mind that the 4KB was maximum size of a standard (non bank-switched) *ROM* cartridge.

      Of course, one would need some RAM for keeping track of variables, data, etc. as well, and the 2600 had some onboard- a grand total of 128 *bytes*!

      Plus, there was no screen memory as such, just the graphics chip registers which held enough data to generate one line, and had to be updated every time you wanted a subsequent line to be different.

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
  33. Hats off by Anonymous Coward · · Score: 0

    I've had a double take after seeing 'grammar' and 'irregardless' in the same line and had to re-read it all. Well played sir :)

  34. The Tetris Company by tepples · · Score: 1

    How long until The Tetris Company fires its next round of takedowns?

    1. Re:The Tetris Company by discord5 · · Score: 1

      How long until The Tetris Company fires its next round of takedowns?

      They'll start once the lawyers stop salivating on the license included with the javascript.

      They're seeing dollar sings already.

  35. html tag by StripedCow · · Score: 1

    I wouldn't be surprised if, one day, W3C would add tetris to the (already hairy) HTML specification. Then, a mere 9 bytes would suffice:

    <tetris/>

    You see, sadly, the most effective language for targeting the web, HTML, was never designed for experienced programmers but for the average joe who doesn't care about formal languages anyway.

    --
    If Pandora's box is destined to be opened, *I* want to be the one to open it.
    1. Re:html tag by mysidia · · Score: 1

      but for the average joe who doesn't care about formal languages anyway.

      Yeah... the average joe can't use HTML. They would use a visual editor.

  36. Next by Anonymous Coward · · Score: 0

    Make them do it in Brainfuck.

  37. Slashdot has forgotten history by Anonymous Coward · · Score: 0

    Has all the coders of the 80's/90's demoscene died already?

    1. Re:Slashdot has forgotten history by equex · · Score: 1

      No we haven't and I'm laughing a little about this. Still remember occasionally hardcoding 6x6 fonts manually into the source code, then writing text rendering code (in 68k asm) to actually get some text on screen.

      --
      Can I light a sig ?
  38. Interesting by mysidia · · Score: 2

    This is easier than any game of Tetris I ever played... there's a nice grid of dots displayed to line up pieces with.

    And when you get a two-column piece, it allows you to move the right half of the piece off screen, causing the piece to "wrap" around the edge of the screen....

  39. Fail - it's actually 845 bytes. by Barbara,+not+Barbie · · Score: 5, Informative

    If you actually look at the code, just the javascript is 733 bytes after taking out all whitespece, etc, not 140. And this doesn't count the html that embeds it - an additional 112 bytes, for a total of 845 bytes.

    --
    Let's call it what it is, Anti-Social Media.
    1. Re:Fail - it's actually 845 bytes. by Amouth · · Score: 2

      yea all i saw was a single function under 140.. but it doesn't have any controls or display.. not what i consider a full game

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    2. Re:Fail - it's actually 845 bytes. by Anonymous Coward · · Score: 1

      Agreed, the 140 bytes does not include the update loop, display or input handling routines, which I think is a big cheat. Even the most advanced computational systems can be considered **useless** of they have no input or output.

  40. Re:Obilg Bill Gates (if he ever said it) reference by MobileTatsu-NJG · · Score: 4, Funny

    Did you know that the word 'obligatory' came from the Greek God Obligatius who, on occasion, would entertain Zeus with stand-up philosophy? One night he told an off-color joke about Rhea, it made all the gods laugh except for one. Zeus was so angry he punished Obligatius by making him tell the same joke over and over again until he can find somebody who'll laugh at it. To this day, he still wanders the earth saying "640k should be enough for everybody!"

    --

    "I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)

  41. The Smallest Game of Tetris by Hugh+Pickens+writes · · Score: 2
    The world's smallest game of Tetris took place in 2002 under an electron microscope using 42 glass microspheres at the Department of Physics of Complex Systems in Amsterdam.

    A real-life implementation of the evergreen arcade game Tetris was obtained by optically trapping 42 glass microspheres (1 micrometer diameter) in a 25 micrometer x 20 micrometer sized field under a microscope. Their positions were then steered with a computer. The generation of multiple traps, as well as the computer-steering, was accomplished by the use of acousto-optic deflectors: devices that tuned the deflection of a laser beam for a very fast response.

  42. You can do brilliant stuff by Albert+Sandberg · · Score: 1

    .. in 128b, check this out for size: sponge

    There are plenty more demos at that site.

    1. Re:You can do brilliant stuff by equex · · Score: 1

      Plenty ? How about almost every demo ever made. http://www.pouet.net/groups.php?which=926 --- Amiga demos I was part of :D

      --
      Can I light a sig ?
    2. Re:You can do brilliant stuff by Albert+Sandberg · · Score: 1

      Yeah, and I've been part of almost every production from outbreak but I didn't come here to brag ;-)

      (I'm thec of outbreak btw)

    3. Re:You can do brilliant stuff by equex · · Score: 1

      didn't post to brag, more to show that the place has demos from the early 90s.

      --
      Can I light a sig ?
    4. Re:You can do brilliant stuff by Albert+Sandberg · · Score: 1

      *presses invisible like button*

    5. Re:You can do brilliant stuff by equex · · Score: 1

      Nice list :) Our group pretty much died because we had to go to the military.

      --
      Can I light a sig ?
  43. Spoier Re:Read the source code - lov by mrmeval · · Score: 1

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                                            Version 2, December 2004

      Copyright (C) 2011 YOUR_NAME_HERE

      Everyone is permitted to copy and distribute verbatim or modified
      copies of this license document, and changing it is allowed as long
      as the name is changed.

                            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
          TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

        0. You just DO WHAT THE FUCK YOU WANT TO.

    --
    I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
    1. Re:Spoier Re:Read the source code - lov by mrmeval · · Score: 1

      Now why did that get past the lameness filter? Is there some AI running in the background or is there uncooked meatware reading every post?

      Oh my gods is that why the posts are so crazy? There's a million Indians approving all posts? Or is it a time clone of Cmdr Taco???

      How hideous.

      --
      I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
  44. Twitter programmes by Anonymous Coward · · Score: 0

    A couple of years ago, there was an album released of twitter programmed that made music with SuperCollider. Some of the music on it is pretty impressive, especially given the constraints.

    http://supercollider.sourceforge.net/sc140/

  45. Re:lol. by Amouth · · Score: 1

    that isn't old - how much space a webpage uses is a big deal based on your traffic levels..

    --
    '...if only "Jumping to a Conclusion" was an event in the Olympics.'
  46. Re:Javascript in 1K by TaoPhoenix · · Score: 3, Interesting

    The Chess entry makes a good sobriety test! : )

    http://js1k.com/2010-first/demo/750

    --
    My first Journal Entry ever, in 8 years! http://slashdot.org/journal/365947/aphelion-scifi-fantasy-horror-poetry-webzine
  47. Tetris is NP-Hard by Anonymous Coward · · Score: 0

    Making a tetris solver is non-trivial problem, mathematically related to the minimal subcover problem and the best
    one can do is an approximation algorithm, (the standard approach would be via some kind of greedy matching algorithm
    for mapping blocks into holes). There are even inapproximability results for hard limits on the accuracy of polynomial time
    approximate solutions. It's probably NP-complete, (the minimal subcover problem from combinatorial topology certainly is),
    so If you can write a polynomial time perfect tetris solver, prizes and place in the halls of history await...

    Combinatorial topological entropy FTW!

  48. Get off my lawn! by billcopc · · Score: 3, Informative

    Back in the good ol' days, when men were men, and Java was just a retarded twinkle in Gosling's eye, we had 256-byte competitions in assembly language. Anything using an interpreter is an immediate disqualification, unless your interpreter + script somehow fit inside the 256 byte limit. Basically, any dependency that isn't part of the hardware, BIOS, or low-level OS functionality like disk I/O, must be included in the byte total. Libraries, interpreters, resource blobs, it all adds up.

    And now, a real Tetris in 256 bytes: http://www.users.globalnet.co.uk/~jchap/tvprotet.htm

    Get that goddamned Javascript hack out of my face.

    --
    -Billco, Fnarg.com
    1. Re:Get off my lawn! by Anonymous Coward · · Score: 0

      You forgot to mention that in the breaks between the competitions we used to catch Velociraptors with our bare hands !
      I miss the good old times with the Tyrannosaurburgers.

  49. Re:Javascript in 1K by AsmCoder8088 · · Score: 1

    Nice... However it does not implement castling.

  50. Alphametics in 100 bytes by Michael+Woodhams · · Score: 1

    I and another wrote an alphametics solver in Perl in under 100 bytes. (e.g. SEND+MORE=MONEY. Each letter stands for a distinct digit. Find an assignment of digits to letters that makes the arithmetic correct.) Alas, I don't have the code to hand to post it. The basic algorithm was:
    (1) $x= pop @ARGV. If it is empty, quit.
    (2) If $x contains no letters, print it if it 'eval's to true.
    (3) otherwise pick a letter, and make copies of $x with that letter replaced by every digit not already in $x (unless doing so would give a number with a leading 0). Push these back onto @ARGV.
    (4) loop to (1).

    To run, give the problem in Perl format on the command line:
    $ perl alphameticssolver send+more==money
    As it is doing an exhaustive search of up to 10! potential solutions, it takes a few minutes to run.

    --
    Quattuor res in hoc mundo sanctae sunt: libri, liberi, libertas et liberalitas.
  51. I would say very nice by patriciacurtis · · Score: 0

    But there are some bugs in it, like scroll your block left left left and it fills the screen with blocks, while also taking the block back up the screen..... so nice idea nice try but no cigar! it cant be called a game it can be called a test demo, not much more! Sorry for being so harsh.

    --
    http://luckyredfish.com
  52. Shortest program contest by Anonymous Coward · · Score: 0

    In the 1970s I won a programming contest for the shortest program to calculate the highest power of two that divides into a given number (e.g, given 12 the answer is 4 as 4 divides into 12 but 8 does not). My solution took 4 bytes and was the only one that did not have a loop in it. The person judging them told me that he originally threw it in the bin as it obviously couldn't work without a loop. Later he got curious and tried it out and found it always worked. He said that he could not believe that he could not understand how a 4 byte program worked. It was in IBM 360 assembler and consisted of LCR y,x then NR y,x.

    1. Re:Shortest program contest by _0xd0ad · · Score: 1

      In the 1970s I won a programming contest for the shortest program to calculate the highest power of two that divides into a given number (e.g, given 12 the answer is 4 as 4 divides into 12 but 8 does not). My solution took 4 bytes and was the only one that did not have a loop in it. The person judging them told me that he originally threw it in the bin as it obviously couldn't work without a loop. Later he got curious and tried it out and found it always worked. He said that he could not believe that he could not understand how a 4 byte program worked. It was in IBM 360 assembler and consisted of LCR y,x then NR y,x.

      Nope. That would just equal zero. Try:

      LNR y,x
      NR y,x

  53. "so if _you're_ bored" by Anonymous Coward · · Score: 0

    Does /. have any editors?

    It should be "so if you're bored," not "so if your bored."

    You're welcome.

  54. Not Tetris... maybe Bitris? by k31 · · Score: 1

    This isn't Tetris.... Tetra, meaning four, is the basis of that name... the blocks in Tetris are made up of four cells. However, in this game, they are either one cell or two cells. So at most I would call it Binary Block Game or something like that.

    Amazing accomplishment, nonetheless.

  55. Sure by Anonymous Coward · · Score: 0

    The game is buggy as hell, make it better.

  56. "Nibble" Magazine's Two-Liners & Beagle Bros by Sebastopol · · Score: 1

    Anyone remember the last page of every issue of Nibble, that featured "two liner" contests? The goal was to write something in two lines of Applesoft basic, and the winners always managed to blow my mind. Beagle Bros released a disk of of these in the early 80's.

    Glad to see this kind of challenge returning!

    --
    https://www.accountkiller.com/removal-requested
  57. Aaah the nostalgia by Trogre · · Score: 1

    Reminds me of those wonderful 256 byte PC assembly demo compos.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  58. Icon by jones_supa · · Score: 1

    The programming category icon of Slashdot could be a screenshot of this game.

  59. Who cares about bytes by Tablizer · · Score: 1

    Screw these arguments about byte counts. I think it's just cool to play ASCII versions of old-school vid-games.

    Where's ASCII PacMan and Space Invaders?
         

  60. There is a BUG by Anonymous Coward · · Score: 0

    Just trying this "awesome" Tetris. By continuos typing [right arrow] it brokes the display. Funny :)

  61. Re:Obilg Bill Gates (if he ever said it) reference by iapetus · · Score: 1

    But he did say "What's a network?"

    --
    ++ Say to Elrond "Hello.".
    Elrond says "No.". Elrond gives you some lunch.
  62. Math and Sporks by garthsundem · · Score: 1

    Wow, that's actually kind of beautiful -- with the same beauty as a good mathematical proof or Man's most efficient invention: the spork.

    --
    GeekDad, TED speaker, Wipeout loser, author of Brain Trust
  63. Puhlease! by Anonymous Coward · · Score: 1

    140 bytes + the javascript interpreter. Give me tetris in 140 bytes of machine code, or shutup.