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."
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?
........ to do ..... Pretty interesting use of sed because ......"
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
Just a thought.
(this is how it works)
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.
Would you prefer a sed binding for SDL?
;)
(I probably shouldn't give him any ideas... )
Loren Osborn
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. :)
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.
- sed: 2266:
./sokoban.sed: unexpected EOF (pending }'s)
Once again, GNU tools rule over BSD tools. Well, for gaming, anyway.-- @rjamestaylor on Ello
$ ./sokoban.sed
Too many {'s$
Bleh...
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... :)
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
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}/;}'
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.