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

12 of 149 comments (clear)

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

  2. Not bad by John+Ineson · · Score: 2, Interesting
    But dc.sed takes some beating. Square roots with regexps anyone?

    (this is how it works)

  3. 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.
  4. 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
  5. 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. :)

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

  7. 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
  8. Doesn't work on Sun, either: by larien · · Score: 3, Interesting

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

    Bleh...

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

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

  11. 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}/;}'

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