Slashdot Mirror


SedSokoban

rsd writes: "Have you ever thought that sed is too limited and only useful to Regular Expression scripts? Well, verde666, who works for Conectiva, proved that it can be used for games too. He wrote a sokoban game named sedsokoban with sed. There is even a screenshot."

149 comments

  1. One question: by Jucius+Maximus · · Score: 1, Insightful
    Does pressing 'u' allow you to undo bad moves?

    (This was the case in the original, or at least the older, Sokoban for XTs.)

    1. Re:One question: by Anonymous Coward · · Score: 0

      Moderators: what the hell is insightful about this?

  2. Screenshot Mirror by endikos · · Score: 1

    Here's a mirror of the screenshot.

    http://www.zianet.com/endikos/sedsokoban.png

    1. Re:Screenshot Mirror by Anonymous Coward · · Score: 0

      That really is the most piss poor attempt at karma whoring I have *ever* seen.

    2. Re:Screenshot Mirror by ct · · Score: 4, Funny

      *DING!*DING!*DING! - We have a Winner!

      For a 2kb .png that's the worst attempt at cheap karma this week.

      //ct

    3. Re:Screenshot Mirror by Anonymous Coward · · Score: 0

      Hey, isn't a mirrored image supposed to be the other way around?

  3. Re:Slashcode's HTML vs. Microsoft HTML by ender-iii · · Score: 0, Flamebait

    Do you work for M$? ... tool

    --
    ender-iii
  4. Re:Slashcode's HTML vs. Microsoft HTML by aspjunkie · · Score: 1

    I'm not sure how exactly you think switching to a Microsoft server platform will improve HTML standards conformance. Standards conformance has nothing to do with the platform serving the content, but the code which generates the HTML. Aside from that, this post is grossly _off-topic_.

  5. Okaaaay. by Scotch+Game · · Score: 1, Funny

    Oh yeah? Well, I hack frickin' NT boxes with awk!

    No wait ... The sokoban thing is a lot harder.

    *****
    What would you do if you knew you could not fail?

  6. Drawback by guamman · · Score: 1

    First off, it is truly cool that it was able to be done. I'm a huge fan of accomplishing anything while using extraordinary and/or unusual means. The only drawback I feel is the resolution of game movement limited by the medium. Not the screen resolution, but the square grid that any kind of output in a text based grid has to conform to. Since any movement is limited to the eight nearest squares, games on order of a simple flash game probably cannot be acheived. Not the fault of the designer, just a drawback to the medium. Other than that, rock on!

    1. Re:Drawback by loren · · Score: 2, Interesting

      Would you prefer a sed binding for SDL?

      ;)

      (I probably shouldn't give him any ideas... )

      --

      Loren Osborn

      Software isn't software without source code. -- NASA
  7. All I want to know is... by danny256 · · Score: 0, Offtopic

    how long until we see that text based quake 3 on the sed!

  8. Don't mistake the tool for the skill... by BoBaBrain · · Score: 5, Insightful

    It's possible to sculpt Venus using only a nail file (and a lump of marble).
    That doesn't mean nail files are any more useful than we thought.

    --
    I am a Karma Library.
    1. Re:Don't mistake the tool for the skill... by hey! · · Score: 3, Interesting

      I still use sed on occaision, although there's really nothing you can do in sed that you can't do with 'perl -e ...'. Partly this is because se style re's were just burned into my impressionable young brain back in the days of System III, but also I think that sed really embodies the Unix tools philosophy -- build simple tools that do one thing extremely well.

      Of course this kind of hack shows that even simple tools can be used in unexpected ways. This is a good lesson to remember. This is a little OT, but I was thinking about this fact the other day when I was listening to people talk about placing blame for the security lapses on 9/11. One way to defeat security is to find behavioral possibilities inherent in the implementation of a system that aren't part of its design. In retrospect, it's easy to see you can smash a stack by putting machine language instructions into an unchecked buffer, but this attack was highly original the first time it was attempted. In retrospect, it easy to see that a large airliner loaded with fuel is a flying bomb, but to see this in advance is harder.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    2. Re:Don't mistake the tool for the skill... by Anonymous Coward · · Score: 0

      Jeez, how long have you been saving that one up? Got you an instant 5, must have been worth it.

    3. Re:Don't mistake the tool for the skill... by Anonymous Coward · · Score: 0

      I still use sed on occaision, although there's really nothing you can do in sed that you can't do with 'perl -e ...'.

      True. But I find that using sed rather than Perl ensures I don't end up with something truly awful. If it's easy to do in sed, then I do it in sed. If I can't do it in sed easily, then I do it in some language where it's possible to write maintainable code, like Python.

      The subject of this tstory is an example of someone who really didn't know when he should have stopped with sed, and moved onto Python. +5 for hack value though. :-)

    4. Re:Don't mistake the tool for the skill... by BoBaBrain · · Score: 1

      It's direct from the karma-friendly school of pretzel philosophy.

      ;)

      --
      I am a Karma Library.
  9. It's a slippery slope... by marnanel · · Score: 4, Insightful

    Today it's Sokoban... beware, for before you know it it'll be Elite.

    --
    GROGGS: alive and well and living in
    1. Re:It's a slippery slope... by Ch_Omega · · Score: 1

      Elite for Emacs? Does EMacs have anything to do with iMacs? Perhaps an Enhanced iMac?

      Like it is hard to make an Elite-clone run on anything as powerfull as an Enchanced iMac!! Nerd!

      ;)

    2. Re:It's a slippery slope... by Xenographic · · Score: 1

      No, next it will play nethack; just like autorogue & the Angband borg ;]

  10. Ummm....What? by Tranvisor · · Score: 3, Interesting

    First of all what is sed? Sorry for being late to the party here, but come on, I have no idea what this is about other then somebodies little text-like game?

    Mike, don't you think that you could have contributed like a sentence at the end saying something that would bring the picture a little more into the real world focus? Heck, I would settle for something like "Sed is normally used for ........ to do ..... Pretty interesting use of sed because ......"

    Just a thought.

    1. Re:Ummm....What? by anpe · · Score: 5, Informative

      Sed stands for Stream EDitor. It's part of the New Command-Line eXPerience(tm) that Microsoft ships with Microsoft Word (tm) so that the user can easily writte DOS-mode games while editing.

      If you really don't know what SED is, then Google's your friend : http://directory.google.com/Top/Computers/Software /Editors/SED/

    2. Re:Ummm....What? by kzadot · · Score: 1

      Or you could just type in man sed and understand even more than most of us who at least know what sed is.

    3. Re:Ummm....What? by marnanel · · Score: 5, Informative

      Sed is a stream editor-- it takes a file and modifies it according to your instructions (such as "add a space at the start of every line"). Here's a quick introduction, and here's the sed FAQ from comp.editors.

      --
      GROGGS: alive and well and living in
    4. Re:Ummm....What? by Anonymous Coward · · Score: 0

      Hm... My first thought was: "What an ignorant little...", but then I thought a bit about it and you actually have a point there.

      I myself dont use sed for much more than filtering text streams (sed is a Stream EDitor otherwise) and couldn't enlighten you on the "usuall" usage of sed except for something like this:
      cat filename | sed -e's/bar/foo/g'
      which would replace every occurance of bar with foo in filename (allthough not replacing the original file, instead writing the changed content of filename on standard output)...

      Hope this helps a little bit... :)

    5. Re:Ummm....What? by Fnord · · Score: 2

      Sed is a UNIX command that's mostly used for automated search and replace like editing of text files (to other unix heads who are screaming now, I know its more than that but I'm trying to simplify). It has a programming language built into it but its really cryptic and not nearly as usefull as the regexp search replace feature and so the vast majority of people don't use it, and writing a game out of it is just masochistic (somewhat like the guy that wrote a webserver in postscript). He didn't describe what it was because to anyone who's used unix its almost second nature. Too often people forget that a windows user or whatnot wouldn't have any exposure to such things.

    6. Re:Ummm....What? by blinx_ · · Score: 1

      Quote from the story: "Have you ever thought that sed is too limited and only useful to Regular Expression scripts?"

      Maybe one could then assume that normally sed is used for regular expression scripts?

      --
      Resistance is not futile - www.gnu.org
    7. Re:Ummm....What? by FuegoFuerte · · Score: 4, Informative

      As people have now already said ( yah yah, I know... redundant. Shut up already...) sed is the Stream EDitor. Windows people probably would have no clue what sed is. People new to *nix systems probably would have no clue what sed is. It is often assumed though (possibly incorrectly, but I digress) that the main audience of /. is made up of people not in those 2 categories. (note that I'm not saying there's anything wrong with people not knowing what sed is, just that most people on /. would probably have enough exposure to *nix to know.)

      If you want to know more about sed, look at the man page, available http://linux.ctyme.com/man/man2377.htm

      Also, for anyone who doesn't know/can't figure it out, man page is short for MANual page. If you have any access to a *nix system, I hope you know about man. For those that may not, the man pages are a wonderful help utility provided with linux systems to give information about various programs, commands, etc. A user simply types `man [commandname]` and up pops a helpful page telling all about the command or program. In our case, it would be `man sed`.

      Slightly on a tangent, does anyone know of a help system for *nix similar to the old DOS help system (which MS has so helpfully removed and replaced with that stupid paperclip/dog/whatever)? It was nice to be able to simply browse the available commands, jump from help page to help page, etc. A similar thing for *nix could be nice at times.

      For something more on topic... nice hack. From what little I've played with sed, I can't imagine having the patience to write a game with it. The only question I have is, why?

    8. Re:Ummm....What? by Anonymous Coward · · Score: 0, Flamebait

      God. I'd never thought I'd see the day where someone posting on /. didn't know what sed was.

      It's a clear illustration of how much the demographic has changed. Once /. was the preserve of the Linux elite, now it's overrun with clueless windows weenies....

    9. Re:Ummm....What? by marnanel · · Score: 1

      Slightly on a tangent, does anyone know of a help system for *nix similar to the old DOS help system

      GNU's info?

      --
      GROGGS: alive and well and living in
    10. Re:Ummm....What? by Tranvisor · · Score: 1

      Thank you all so much for the info, I apologise for my newbieness ;) I'm not just a windows weenie, I have installed Mandrake, and I'm trying to learn.

      Thanks again for your understanding :)

    11. Re:Ummm....What? by NuShrike · · Score: 1

      I think it's more of the sign of the language times. These days, people would rather (and usually only know) how to do such a thing in Perl when a simple sed script would have done the job.

      Simplicity and ubiquity (Perl) versus lean, mean and obscure (sed).

      Just the other day, I caught Verio using a Perl command call from an SSI include to get REMOTE_HOST functionality when it's actually less memory/cpu intensive with an almost exact sed search/replace expression.

      Overgeneralization sure, but I see this with scripting at work also. But then, that was one of Perl's goals..

    12. Re:Ummm....What? by Anonymous Coward · · Score: 0

      I don't think this is comparable to a webserver in postscript. After all, postscript is a real programming language with functions, variables, loops, if...then constructs etc. Programming in sed, you basically have no variables except a few text buffers, and flow control is limited to predicated expressions and goto.

    13. Re:Ummm....What? by Anonymous Coward · · Score: 0

      man date
      man touch
      man mount

      Jesus fucking Christ... I didn't believe the infamous Linux Gay Conspiracy document, but you have to wonder when you find things like this.

    14. Re:Ummm....What? by bluebomber · · Score: 2

      Didn't some of the xman versions provide links from page to page?

    15. Re:Ummm....What? by Anonymous Coward · · Score: 0

      >Sed stands for Stream EDitor. It's part of the >New Command-Line eXPerience(tm) that Microsoft >ships with Microsoft Word (tm) so that the user >can easily writte DOS-mode games while editing.

      I wonder who scored this as 4 "informative". :)

    16. Re:Ummm....What? by aussersterne · · Score: 3, Informative

      I hope whoever moderated this to "informative" isn't taking it entirely seriously...

      sed stands for "Stream EDitor" yes, but it is not at all to do with Microsoft. sed has been a staple command used with Unix operating systems for a long, long time and you'll find details about using it in any good Unix book.

      --
      STOP . AMERICA . NOW
    17. Re:Ummm....What? by Anonymous Coward · · Score: 0
      Or you could just type in man sed and understand even more than most of us who at least know what sed is.


      Assuming he knows what "man" is, that is...

  11. another side effect of hunger? by ce110ut · · Score: 1

    i don't care what anybody says, i like sokoban more than i like donkey kong. the point? don't let hunger happen to you.

  12. OK - now for 'Quake' written in bash by Anonymous Coward · · Score: 0

    /me cringes at the thought that somewhere in the world, someone is doing just that.

    1. Re:OK - now for 'Quake' written in bash by The+Wookie · · Score: 2

      #!/bin/bash
      /usr/local/bin/quake
      # :-)

  13. Yes, but... by wedg · · Score: 2, Funny

    ...will it julianne fries?

    --
    Jake
    Dating: while( 1 ){ call_girl(); get_rejected(); drink_40(); } return 0;
  14. Not bad by John+Ineson · · Score: 2, Interesting
    But dc.sed takes some beating. Square roots with regexps anyone?

    (this is how it works)

  15. An excellent unix game package.. by sanermind · · Score: 2, Interesting

    Although admitedly this isn't on the topic of cool sed hacks...
    If you haven't heard of or tried it, [and like this sort of game], be sure to also look into
    rocksndiamonds, a truly excellent game for X. It not only has all the classic sokoban levels, but it also does an excellent implementation of Boulderdash, and also Emerald Mine [which I have fond memories of wasting huge amounts of time with on my old Amiga when I was a kid]. Excellent graphics to boot. Plus it's GPL. I've always been suprised that redhat dosen't provide it as an rpm, considering some of the marginal games that they do ship.

    --

    ---
    the pen is mightier than the sword, the sword is mightier than the court, the court is mightier than the pen.
  16. Turing Complete? by Anonymous Coward · · Score: 0

    So is sed a turing complete language? Is anyone going to write a universal machine in sed?

    1. Re:Turing Complete? by Monsieur_F · · Score: 1

      Hey, this was yesterday's topic, not today's ! :)

      --
      McCartney fans pay bus tickets. [...] Lennon fans too, with discretion.
    2. Re:Turing Complete? by protonman · · Score: 1

      Dunno how much sed's from a true Regular Expression language, but if it's pretty close, I'll bet you have a hard time trying to write a universal turing machine in sed....

      --
      The man of knowledge must be able not only to love his enemies but also to hate his friends.
    3. Re:Turing Complete? by Anonymous Coward · · Score: 0

      Sed is turing complete, the regex functions, used for "addresses" and s/// operations is only part of it (though an important part).

  17. Re:Slashcode's HTML vs. Microsoft HTML by Anonymous Coward · · Score: 0

    Still curious, I tried running msn.com and microsoft.com through the validator. I was totally taken aback when the validator reported ZERO ERRORS in *either* of these pages.

    You just lied. msn.com has errors, and it won't even attempt to validate microsoft.com. Maybe your "microsoft compliant" browser is misleading you.

  18. No. by marnanel · · Score: 4, Informative

    Unfortunately not-- though I'm sure you could submit a patch if you felt like it. See the docs:

    #r h or <left-arrow> - move left
    #r j or <down-arrow> - move down
    #r k or <up-arrow> - move up
    #r l or <right-arrow> - move right

    There's a handler in there for the "p" key, though I'm still not sure what it's supposed to do. It seems to put sed into an infinite loop.

    --
    GROGGS: alive and well and living in
    1. Re:No. by knulleke · · Score: 2, Funny

      Obviously p is for pause

      --
      no sig error.
  19. Sokoban in Nethack by 6R1MM · · Score: 5, Informative

    I'd just like to point out that sokoban can be played inside nethack. It's actually a series of levels in the game called The Sokoban Tower. For those that don't know, nethack is an ASCII-based graphical RPG with movement controls inspired by vi.

    1. Re:Sokoban in Nethack by Anonymous Coward · · Score: 0

      Nice use of the word "inspired" in conjunction with "vi movement controls" BTW.

    2. Re:Sokoban in Nethack by Ravagin · · Score: 3, Insightful

      And how! I was considering a facetious comment along the lines of "Hey, that looks like a nethack level..." but that would only work in a group of nethack players.

      Anyway, you left out the part about it being the best game in the world, etc. Diablo? Diablo is for people with short attention spans who like shiny graphics. Us hardcore gamers (with, er, 386s...) know where it's at. [/joking- play whatever you like, it's a theoretically free world]

      The curious ought to go to nethack.org and give it a shot. If you're new and using DOS/Win, try the graphics version. But whatever the interface, the game is highly addictive.

      --

      Karma: T-rexcellent.

    3. Re:Sokoban in Nethack by Speare · · Score: 2
      There is a sokoban puzzle in the middle of the text adventure game, Zork II. If you think Sokoban is challenging with a top-view graphical representation, try it in first-person prose. All you see is "a sandstone wall on your west, a sandstone wall on your south, and a marble wall on your east" and all you can try is "push the west wall."

      Heck, when you first encounter it, you don't even know it's a Sokoban puzzle. You just find these goofy walls. It's only after carefully exploring and mapping the free and open areas and the wall materials that you might see your map as something else. Finally you can start working out on paper what you need to do.

      I played this on an Apple II, and it's still available in the Infocom collection. Heck, play it on your Palm Pilot.

      --
      [ .sig file not found ]
    4. Re:Sokoban in Nethack by AJWM · · Score: 2

      For those that don't know, nethack is an ASCII-based graphical RPG with movement controls inspired by vi.

      To elaborate further, nethack is a latter-day version of hack, which in turn was a descendant of the original rogue . (Which, as the man said, is an ASCII/curses based RPG.)

      --
      -- Alastair
    5. Re:Sokoban in Nethack by taradfong · · Score: 1

      Actually you're right on but you're thinking Zork III.

      --
      Does it hurt to hear them lying? Was this the only world you had?
  20. one word "REPTON" by rednuhter · · Score: 1

    The original original this styly of game on the BBC micro.

    I remember the last incarnation "Repton Infinity" alowed you to even script objects and actions.
    But he had many adventures before that, "Repton through time", "Repton somthing or other ...." (I seem to have 4goten)

    Must have been at least 11 years ago !

    --
    ERR 411[Max number of witty sigs reached]
    1. Re:one word "REPTON" by jonr · · Score: 2

      Argh... Repton 2 was of course just pure evil. I never actually finished it. Must find it for my BBC emulator, Hmm... how to read 320K 5¼ floppies on a PC...

    2. Re:one word "REPTON" by Anonymous Coward · · Score: 0

      If Repton is 11 years ago (1991), then it can't be anywhere near the original. I recall Boulderdash from about 1983.

  21. Re:Slashcode's HTML vs. Microsoft HTML by Zerotheos · · Score: 1
    Maybe M$'s site didn't produce any errors because when you run it through the same check as slashdot.org you get this:

    Fatal Error: no document type declaration; will parse without validation

    However, you get an extreme amount of errors if you manually select the doctype. Maybe you should 'research' a little better, eh? Troll on llama.

  22. Re:Slashcode's HTML vs. Microsoft HTML by gilroy · · Score: 1, Offtopic
    Blockquoth the poster:

    Still curious, I tried running msn.com and microsoft.com through the validator. I was totally taken aback when the validator reported ZERO ERRORS in *either* of these pages.


    Interesting. When I tried "www.microsoft.com", I received the much more alarming

    Fatal Error: no document type declaration; will parse without validation
    I could not parse this document, because it uses a public identifier that is not in my catalog.
    You should make the first line of your HTML document a DOCTYPE declaration, for example, for a typical HTML 4.01 document:


    It seems to me that "fatal error" is a lot worse than a bunch of formatting tags that don't parse. Of course, this is Microsoft, where "fatal error" is better known as "standard operating procedure". :)


    Oh, by the way, the page choked on both Opera and IE, so it's not a browser thing. And it choked on "microsoft.com", too. On the other hand, "msn.com" only produced 19 errors, of essentially the same type as "slashdot.org".

  23. Re:Slashcode's HTML vs. Microsoft HTML by Pussy+Is+Money · · Score: 1

    A HTTP server that always returns "YOUR NOSE IS BLEEDING" is bound to result in something that violates the HTML spec. Although perhaps the way HTML is heading in a few years time "YOUR NOSE IS BLEEDING" will be a valid response as well.

    --
    Pushin' 'n dealin', shovin' 'n stealin'
  24. *cough* by Anonymous Coward · · Score: 0, Insightful

    Score 3 interesting for not knowing what sed is. How times have changed. A snapshot of today's slashdot crowd right here for us.

    And I'll probably get moderated down but then again, perhaps that makes sense, because it is I, who is the stranger now.

    1. Re:*cough* by Anonymous Coward · · Score: 0

      hmm, score 5 for pointing out that not everyone knows it. dunno about good old times but today it seems quite reasonable.

  25. Finally... by Constrain_Me · · Score: 2, Funny

    I've found a use for Cygwin ;)

    1. Re:Finally... by Anonymous Coward · · Score: 0

      Next you should find a use for your life, wanker

    2. Re:Finally... by MegaFur · · Score: 1

      It does work, btw--with Cygwin, I mean. I played through a couple of levels on it last nite. Only weird thing--some of the levels have *'s in them and it seems to make those levels less/un-playable.

      --
      Furry cows moo and decompress.
  26. Tried it out by tuxlove · · Score: 2, Interesting

    This is totally cool. Very creative. Reminds me of the Towers of Hanoi vi script I've seen floating around. Also the maze generator/solver in vi script. The vi scripts are cool because they use parts of the screen to store variables. :)

    1. Re:Tried it out by DrSkwid · · Score: 4, Funny

      yes, such a refreshing change from using variables to store parts of the screen :)

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    2. Re:Tried it out by DahGhostfacedFiddlah · · Score: 1

      There was a ToH written for the C preprocessor a few years ago for the obfuscated C competition. It recursively #included itself printing out warnings, if I recall correctly.

  27. Now what we need is... by po8 · · Score: 4, Interesting

    Consider the case of Andreas Junghanns, who wrote Rolling Stone, the world's top machine Sokoban solver, in C. I'm sure that even as you read this he is working on rewriting it in the Sokoban-friendly language sed.

    Or not.

  28. Uh by Anonymous Coward · · Score: 0

    Who cares? This would be even easier to accomplish in a DOS shell.

  29. Intercal by krut · · Score: 1

    Now we are just waiting for someone to do an intercal version of Sokoban.

  30. News for Nerds by heinzkeinz · · Score: 0

    This story has been posted purely to satisfy those who complain that Slashdot is not News for Nerds anymore.

  31. Re:Slashcode's HTML vs. Microsoft HTML by King+of+the+World · · Score: 0
    Hi,

    By .NET I assume you mean .NET Web Forms, and this model produces it's own HTML (datagrids/lists/etc.). It is standard's based but it is ultimately uncontrollable.

    When you're talking about standards (as many people often do) it would be nice if you actually named some specific versions and not just that vague "standards" idea. Which ones? Netscape 4 has four tags to remove page margins and other browsers (all other browsers) ignore the four attributes. It will break standards, but it won't hurt anyone, and when used correctly it will only enhance older browsers.

  32. A wise man once said... by ct · · Score: 5, Funny

    To quote Chris Rock in Bigger and Blacker,

    "Just because I can drive a car with my feet - doesn't make it a good fucking idea".

    //ct

  33. Under OS X by rjamestaylor · · Score: 4, Interesting
    It runs under OS X (no Aqua support though...kidding) BUT not using Darwin/BSD's sed (/usr/bin/sed), rather using Fink's sed (/sw/bin/sed). Using the default sed, I get this error:
    • sed: 2266: ./sokoban.sed: unexpected EOF (pending }'s)
    Once again, GNU tools rule over BSD tools. Well, for gaming, anyway.
    --
    -- @rjamestaylor on Ello
  34. this'll show 'em by hazyshadeofwinter · · Score: 1

    let's see those perl weenies do *this*!

    Tommorrow: Slashcode to be rewritten in sed.

    --
    Click here if you just like to click on shit.
    1. Re:this'll show 'em by WWWWolf · · Score: 2, Insightful

      Hey, let's not be unfair. At least we Perl users have terminal control libraries and something that looks like a programming language. Besides, using sed for "real" programming is hard and challenging and people stand in awe, but using Perl for real programming is just fun and no one notices if you program something infinitely cool with it, because Perl was made so that infinitely cool things could be made easily.

      This hack is impressive because it was made in a toothless environment, not because it has not yet been implemented in some better language =)

  35. Never underestimate a scripting language... by seanadams.com · · Score: 2

    Here's something I made a while back in case anyone's interested:

    Perltris

    1. Re:Never underestimate a scripting language... by flegged · · Score: 2

      Yeah, I wrote Tetris (and a few others) in JavaScript (for DOM level 1 browsers - Mozilla or IE5 will work) a while back. I also wrote Tetris in C++ (source is here; works under Wine) when I was learning DirectX. The blocks.js became blocks.h with a few search and replaces.

      So Tetris is kindof my "Hello World" when learning a new language. I don't think I'll try to write it in sed though. :o)

      --

      "I think he was truly surprised at how little I cared about how big a market the Mac had" - Linus on Jobs
    2. Re:Never underestimate a scripting language... by Gid1 · · Score: 2
      So Tetris is kindof my "Hello World" when learning a new language.
      Me too, until I got a Cease and Desist order from the Tetris company! =(
    3. Re:Never underestimate a scripting language... by Anonymous Coward · · Score: 0

      You rotate your pieces in the wrong direction (at least when I hit up arrow). Makes it unplayable for me.

  36. Doesn't work on Sun, either: by larien · · Score: 3, Interesting

    $ ./sokoban.sed
    Too many {'s$

    Bleh...

    1. Re:Doesn't work on Sun, either: by cscx · · Score: 1

      Yap... same here.

  37. Doesn't work on Solaris by boltar · · Score: 0

    Gives a too many commands error. Perhaps a bit more debugging required hmm?

  38. Is sed Turing complete? by hankwang · · Score: 1

    If sed provides the essential capabilities for programming such a game, it probably satisfies the criterion for being Turing complete. It can be proven that any Turing-complete device can in principle do what any other Turing machine or computer can do.

    Hence, it is probably possible to write an processor emulator in sed which can run an operating system and any software that exists in that operating system. It would only be a bit slow.

    1. Re:Is sed Turing complete? by GigsVT · · Score: 1

      Yeah, and it's possible to chop down a tree with a butterknife, but no one is that stupid. :)

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
  39. strange hacks hall of fame? by petis · · Score: 2, Interesting

    Is there such a thing as a sh-hof? In that case I would like to nominate the sed hack in the story, and this webserver written in postscript... :)

  40. Proof that sed can in fact do everything... by earthy · · Score: 2, Interesting
    Well, this seems as good a place as any to mention the sed script I wrote some 4 years ago that emulates a Turing machine. The script is actually capable of performing any calculation one can write a Turing machine program for... addition of two numbers is provided as an example.

    Oh, ofcourse, the sed Turing Machine is on the web as well. :)

    Owh, by the way, it's pretty readable sed code... it's had to be for me to finish it. :)

    Arthur

    1. Re:Proof that sed can in fact do everything... by earthy · · Score: 1
      I just saw the spazioweb.inwind.it/seders website, and noticed that Christophe Blaess built a Turing machine emulator in sed as well last year... apparently there's more people as geeky as me.

      Anyway, his implementation has the number of characters the sed-implementation allows minus three as a limit on the total number of states in the Turing machine, which mine doesn't.

  41. SedSokoban? by InsaneCreator · · Score: 2

    Games for SED? Now I've seen everything. So what's next? Textmode quake 2?

  42. What? Sed not usefull??? by gunix · · Score: 0

    There is a http server written i sed as well... can't find the link right now...

    --
    Evolution of Language Through The Ages: 6000 BC : ungh, grrf, booga 2000 AD : grep, awk, sed
  43. Will conectiva by C0vardeAn0nim0 · · Score: 1

    include this game in the next version of their distro ?

    --
    What ? Me, worry ?
  44. 512 byte sokoban by divec · · Score: 2

    I'm impressed that it's possible in sed. Here's a smaller one, in perl, but I dunno if it'll work on Win32.

    --

    perl -e 'fork||print for split//,"hahahaha"'

  45. how to fix errors on Solaris by Anonymous Coward · · Score: 1, Interesting

    hi, i'm aurélio, the author of sedsokoban.
    thanks for all the comments, i'm very happy about
    them &:)
    the errors on Solaris it's because on your sed
    version, the branch command (b) must be the last
    thing on the line.
    just apply this sed command on the script and it
    will work:
    sed '/bx;}/{G;s/bx;}\(\n\)/bx\1}/;}'

    1. Re:how to fix errors on Solaris by boltar · · Score: 0

      Still doesn't work. I just think the programs too big for our version of sed.

  46. Batch-games. :) by Ch_Omega · · Score: 1

    I used to make huge adventuregames in the MS-DOS Batch-language, back in 91-93. Complete with ascii "graphics" and all..
    One of them even had a level-system where your character increased levels, all using the VERY limited batch variable system in connection with the choice.com thingie that became standard in MS-DOS 5 or 6. ...And batch is alot simpler and primitive than Sed. ;)

    Ofcourse, I vouldn't dream of even attempting to make anything like Sokoban in Batch. =)

  47. This is sick by mschmitt · · Score: 1

    This is sickest thing I've ever come across in my whole life. People (children even!) are suffering and dying from hunger in the world, and this guy wastes his time using sed as a programming platform for 2D action!

    Oh my god, how I love it! Pure genius! :-)

  48. actually this is sick by Anonymous Coward · · Score: 0

    Did you look around his homepage? this guy is definatly a sick fucker. Here is just one of the many FUCKED UP things in his photo gallery. Of course i always wondered what that kind of thing would look like. Unfortunatly my breakfast is ruined, but still, didn't you always kinda wonder if that could happen and if it did what would it look like? hmmm, i don't think an american company would hire a fellow with that sort of shit on his homepage.

    1. Re:actually this is sick by Anonymous Coward · · Score: 0

      You dont think an american company would hire a fellow with that shite on his homepage? Man... isn't America the haven/breeding ground for that kind stuff?

    2. Re:actually this is sick by Anonymous Coward · · Score: 0

      well it is, but you're not supposed to show interest in it anywhere your boss can find it hehe...

  49. It's OK as long as it isn't called TETRIS� by yerricde · · Score: 1

    Me too, until I got a Cease and Desist order from the Tetris company!

    As long as you don't call it TETRIS®, you should be fine. Games in and of themselves cannot be copyrighted, and falling tetrominoes aren't patented in the US or the EU. Call it something weird like BinaryBlocks Game or freepuzzlearena or something, and The Tetris Company will have no grounds for a trademark lawsuit. Sorry Henk...

    --
    Will I retire or break 10K?
  50. tetris / sokoban in VIM by skt · · Score: 2

    that reminds me of the tetris game I played a while ago written in VIM's native scripting language. The tetris game is here IIRC. Heh, and when I was looking for that there seems to be a sokoban game in VIM too..

    1. Re:tetris / sokoban in VIM by distributed.karma · · Score: 1

      If you read through sokoban.sed, you'll find it's partly based on VIM Sokoban (at least the levels). Also the movements are HJKL and quitting is with :q.

      --

      --
      If you moderate this, then your children will be next.

  51. Re:Slashcode's HTML vs. Microsoft HTML by Anonymous Coward · · Score: 0
    Apart from the fact that this is offtopic, you should consider that there are some pretty common things in HTML that simply cannot be done in a W3C-approved way (like borderless frames).

    The fact that it validates as W3C-approved HTML doesn't neccessarily mean that it will work on ANY browser (including Mozilla) ...

  52. Life is too short by Perl-Pusher · · Score: 1

    While I think that writing a game in sed is neat. I can't imagine putting that much effort into it. I guess I'm a slacker, I like to see the sun and interact with others.

    1. Re:Life is too short by Anonymous Coward · · Score: 0

      You're out of luck then.. the script doesn't work on a sun box.

  53. Quake by TestBoy · · Score: 1

    I hope he programs a version of sedQuake next. Nothing like a happy face running around a screen shooting people with all those neato ascii characters. Oh the joy!

  54. Not the only sed game by Fluffy+the+Cat · · Score: 3, Informative

    See http://www-jcsu.jesus.cam.ac.uk/~gsb29/sedgames.ht ml for sed versions of pong, noughts and crosses (tic tac toe in the US, I think), a webserver and a program for translating bf into C.

  55. Interesting game. by distributed.karma · · Score: 1

    This is my first exposure to Sokoban and I'm already addicted.. well probably because it's hacked in sed. My 2 Eurocents on this game are that it's easier than it seems. Because in many games of this sort, you have to rely on other 'blocks' (or whatever they happen to be) to utilize others, so you have to plan things carefully. But in Sokoban, it seems, other blocks are simply on your way, and it's best to get the easy ones first. Or can someone prove me wrong?

    --

    --
    If you moderate this, then your children will be next.

    1. Re:Interesting game. by Anonymous Coward · · Score: 0
      My 2 Eurocents on this game are that it's easier than it seems ... Or can someone prove me wrong


      Keep going... you'll find out.

  56. Sick programmers... by IdleTime · · Score: 1

    If you really want to see how sick programmers spend their time, surf over to The Obfuscated C Contest. It has been going on for years, I used to try it back in the 80's, but I was not sick enough! LOL!

    Check out the archives and try to compile the winners and at last run the result for both amazement and amusement.

    Good Luck!

    Oh, the SED Sokoban was neat, but I lost interest after 8 moves... So much for your work...

    --
    If you mod me down, I *will* introduce you to my sister!
  57. Undo (kind of) by distributed.karma · · Score: 1

    Each command ('h' for left, for instance) is a string you have to enter into the game. It's a normal line input and you see what you're typing. Therefore you can also Backspace to remove unwanted commands before ing them.

    --

    --
    If you moderate this, then your children will be next.

  58. insane... just insane.... by trappedinabox · · Score: 1

    My first question would have to be.. WHY man...WHY??? Fantastic work but.... WHY???? I patiently await your sed-driven text version of quake 3 arena

  59. Have you ever... by Anonymous Coward · · Score: 0
    Have you ever thought that sed is too limited and only useful to Regular Expression scripts?

    Yes. End of discussion.

    Move along. Nothing to see here.

  60. Towers of Hanoi & Mandelbrot for vim by adadun · · Score: 2

    Linus Åkerlund's Towers of Hanoi implementation for vim. can be found here. He has also written a cool Mandelbrot set generator in vim that can be found on the same page.

  61. NEW VERSION 0.1 JUST POSTED! by Anonymous Coward · · Score: 0

    MOD THIS UP! He just posted a new version on the site, this one includes :q :r :z :gN options!

    #r COMMANDS
    #r :q quit
    #r :r restart level
    #r :z refresh screen
    #r :gN go to level N

    http://verde666.org/sed/sokoban/sokoban-v0.1.sed

  62. sed by Qwerpafw · · Score: 1

    This is a joke, right? Sed is a "DOS game writing app for windows XP?" Surely you jest.

    Sed is a unix command to manipulate text streams. similiar to "awk." It is kind of like a command-line "find and replace" function. Only better :)
    Perl is like a much more advanced, super-evolved, and uber-powerful version of sed.

    Let the man be your friend. "man sed" on almost any unix box (that includes MacOS X) will help you.
    Sed is not a windows XP command. (at least, unless MS copied unix here...). And Sed's purpose is most definately NOT writing DOS games. Or games of any kind. Which is what makes it cool that the guy coud write a game with it.

    1. Re:sed by anpe · · Score: 1

      Sure, it _was_ a joke, I wonder who modded it as "Informative" :-)

    2. Re:sed by Nasheer · · Score: 1

      I believe some moderators did that. Dude, this is getting worse every day...

      "Great! Now tell me again that history about when you died".

      --
      - Please, ignore everything written above.
  63. that ain't right by zerOnIne · · Score: 2

    it's pretty cool nonethe less, though ... reminds me off the jezzball and pong clones i saw written in zcode, the language used for the original zork series and other text-adventure games ...

    --
    09
  64. Turing-complete text editors by Anonymous Coward · · Score: 0

    Does no one remember that the original emacs was written in TECO, a command-line driven text editor from DEC? I believe RMS first wrote a lisp interpreter in TECO macro language, then coded the rest of emacs in lisp.

    1. Re:Turing-complete text editors by James+Youngman · · Score: 1
      Does no one remember that the original emacs was written in TECO, a command-line driven text editor from DEC? I believe RMS first wrote a lisp interpreter in TECO macro language, then coded the rest of emacs in lisp.

      As far as I understand Stallman's paper on the original Emacs, the original Emacs was written directly in TECO. The same paper appears to indicate that the first Emacs written in LISP was Multics EMACS.

      Stallman writes :-

      Indeed, there are ways in which EMACS shows the results of not having been completely thought out in advance: such as, in being based on TECO rather than Lisp
  65. Cheats... by Whispers_in_the_dark · · Score: 1

    I didn't notice any solution scripts for the game so I whacked together a level 1 script. You can find it at:

    Level 1

    Just save the file and use it as stdin for the game and watch the little '@' go! Does anyone else had cheats like this for the game?

  66. tiny solution contest by verde666 · · Score: 1

    what about a contest to get the shortest solution for a level?
    i've put Whisper's solution to level 1 on the site.
    it has exactly 200 moves.
    if somebody has a shorter one, send me!
    http://verde666.org/sed/sokoban

  67. while we're at it: color in freebsd nethack? by hawk · · Score: 2
    I thought I had it working forever ago, and I know I used to have it on console (but not xterm) with debian.


    Not that I've ever had a tendency to move into my cat or any such thing . . .


    anyone know how to do this?


    hawk, who still needs to file the bug report in freebsd for nethack being a port rather than the base system (but will face the mkdir/rmdir spelling error bug first!)

    1. Re:while we're at it: color in freebsd nethack? by CoolVibe · · Score: 2
      You xterm-happy kid :) I usually would point you to the documemtation, but since this is somewhat less-obvious, I'll point it out here for you. Stick it in your tool chest, impress your friends, go far away places, meet interesting people, and kill them (to stay a little bit on topic) ;)

      Right, enough silly banter. Pay attention:

      Try this: (in bourne shell derivatives)

      TERM-xterm-color && export TERM

      Or this: (if you use the csh dialect)

      setenv TERM xterm-color

      As you will notice, more apps will be in color now, like mutt et al... Oh, you can have your colored ls(1) too. Check google on how to set that up.

    2. Re:while we're at it: color in freebsd nethack? by CoolVibe · · Score: 1
      Urgh.. of course that should be:

      TERM=xterm-color && export TERM

      for bourne compatible shells... (oh and btw, that 2 minute timeout on /. sucks)

    3. Re:while we're at it: color in freebsd nethack? by hawk · · Score: 2
      >You xterm-happy kid :)


      It's not my fault!


      The boss just won't spring for a 3x3 shelf of VT100's with a wrist-mount inertial switch to connect the keyboard, so I'm stuck with xterms, the *real* reason for using X.



      >I usually would point you to the documemtation,


      Been there, done that. TERM was already xterm-color. This now works, but it wasn't before. It may be that all the colors were used up (I have my drive in a loaner laptop, and only get 8 bit--and it's not worth hunting down an xf86config for the few days involved), or there may have bveen another funky interaction going on.


      But thanks.


      hawk

  68. Can i mirror the image for you by ceethree · · Score: 1

    I would like to mirror the image for you is there any way that i could ... e-mail me shadow_walker@prodigy.net thanks c3

    --
    Yours Truly, Wes -- Owner ... http://www.geekish.net
  69. Talk about fast progress... by wedg · · Score: 2

    ...I think the slashdotting this guy received inspired him.

    When I went here last night, there were two files, the .png screenshot and the original .sed script. Now there's 2 more versions out (0.0 and 0.1) and a contest to see who can solve each level in the fewest moves, along with a solution to level 1.

    Just in case all of you didn't bother to visit it, or didn't visit it twice, you should check it out: The contest makes for some fun gameplay.

    --
    Jake
    Dating: while( 1 ){ call_girl(); get_rejected(); drink_40(); } return 0;
  70. The best graphical version of Nethack... by Jagasian · · Score: 2

    Sure you can play the Nethack with its original ASCII based interface, but the game is far more sexy with a full SVGA Diablo-esque interface (see screenshots on bottom of linked page). Note this game is fully open source, and still actively developed... even after more than a decade! This game has been polished to perfection.

  71. Re:Doesn't work on HP, either: by Anonymous Coward · · Score: 0

    Tried it under Sun and HP with noluck :(

  72. set is an acroynm by Anonymous Coward · · Score: 0

    for
    "obsolete and should be removed from all unix distributions"

  73. Mmm, Literacy. Was Re:Doesn't work on Sun, either: by Harik · · Score: 1
    #r - Solaris sed or other versions which requires b command to be the
    #r last on the line, must do a sed '/bx;}/{G;s/bx;}\(\n\)/bx\1}/;}'
    #r on this file to break the line after the 'bx'

    Perhaps if you READ THE DOCUMENTATION you wouldn't be posting to slashdot like an AOL user.

    --Dan

  74. Sokoban in Batch by Anonymous Coward · · Score: 0

    Why not implement Sokoban in batch? It should be simple enough. I implemented a multiple-window menu system in that language (and I use the term politely) sometime between 1992 and 1994. It featured keyboard navigation and text highlighting. I'd imagine that implementing Sokoban wouldn't be that much harder.

    In fact, much of the same logic could probably be reused, since what is Sokoban except a menu system with options that change the state of the menu (something which my big ol' batch script already handled)? Sure, there are quantitatively more options on a Sokoban than in a 40-state menu, but qualitatively the infrastructure is already there.

    One caveat: I didn't use the "choice" program, but instead used a small COM file that returned a keycode as the errorlevel. Mind you, it was 13 bytes and was created using DEBUG dynamically by the menu system itself if it didn't already exist. I don't think that the NT Hardware Abstraction Layer would like it at all, though.