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?"
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.
You'll love the non-restrictive EULA.
Sigs. We don't need no steenking sigs.
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.
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? /. users; for you, the /. editors. I believe that in this wonderful age of computing, we wouldn't
Not for us, the
begrudge you guys a little help before you hit "submit."
Sincerely,
You're
[Fuck Beta]
o0t!
The function requires an animation loop and event handler otherwise it does nothing. After that, it's way more than 140 bytes.
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.
Chess in 672 bytes
"I bless every day that I continue to live, for every day is pure profit."
Now, this is proper Slashdot material. More of this, please!
Here is my Tetris implementation:
However, it only works on custom Javascript interpreters which have a global a() function that implements a full game of Tetris.
== Jez ==
Do you miss Firefox? Try Pale Moon.
#!/usr/bin/perl
use StupidShitIveWritten::Tetris(tetris);
tetris;
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.
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)
Binary Tetris is based on dominoes instead of tetrominoes and is called Dis.
--
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
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