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."
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.
Today it's Sokoban... beware, for before you know it it'll be Elite.
GROGGS: alive and well and living in
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.
...will it julianne fries?
Jake
Dating: while( 1 ){ call_girl(); get_rejected(); drink_40(); } return 0;
(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
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
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.
I've found a use for Cygwin ;)
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.
To quote Chris Rock in Bigger and Blacker,
//ct
"Just because I can drive a car with my feet - doesn't make it a good fucking idea".
- sed: 2266:
./sokoban.sed: unexpected EOF (pending }'s)
Once again, GNU tools rule over BSD tools. Well, for gaming, anyway.-- @rjamestaylor on Ello
*DING!*DING!*DING! - We have a Winner!
For a 2kb .png that's the
worst attempt at cheap karma this week.
//ct
Here's something I made a while back in case anyone's interested:
Perltris
$ ./sokoban.sed
Too many {'s$
Bleh...
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 =)
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
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...
Games for SED? Now I've seen everything. So what's next? Textmode quake 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"'
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..
#!/bin/bash :-)
/usr/local/bin/quake
#
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.
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.
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
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!)
...I think the slashdotting this guy received inspired him.
.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.
When I went here last night, there were two files, the
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;
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.