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

18 of 149 comments (clear)

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

    4. 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
  4. 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
  5. 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 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.

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

  8. 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
  9. 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

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

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

    Bleh...

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