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."
(This was the case in the original, or at least the older, Sokoban for XTs.)
Here's a mirror of the screenshot.
http://www.zianet.com/endikos/sedsokoban.png
Do you work for M$? ... tool
ender-iii
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_.
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?
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!
how long until we see that text based quake 3 on the sed!
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.
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.
/me cringes at the thought that somewhere in the world, someone is doing just that.
...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.
So is sed a turing complete language? Is anyone going to write a universal machine in sed?
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.
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.
The original original this styly of game on the BBC micro.
...." (I seem to have 4goten)
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
Must have been at least 11 years ago !
ERR 411[Max number of witty sigs reached]
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.
Interesting. When I tried "www.microsoft.com", I received the much more alarming
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".
The Mongrel Dogs Who Teach
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'
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.
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.
Who cares? This would be even easier to accomplish in a DOS shell.
Now we are just waiting for someone to do an intercal version of Sokoban.
This story has been posted purely to satisfy those who complain that Slashdot is not News for Nerds anymore.
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.
--Giving to trolls for the benefit of us all
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
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.
Here's something I made a while back in case anyone's interested:
Perltris
$ ./sokoban.sed
Too many {'s$
Bleh...
Gives a too many commands error. Perhaps a bit more debugging required hmm?
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.
Avantslash: low-bandwidth mobile slashdot.
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
Games for SED? Now I've seen everything. So what's next? Textmode quake 2?
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
include this game in the next version of their distro ?
What ? Me, worry ?
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"'
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 used to make huge adventuregames in the MS-DOS Batch-language, back in 91-93. Complete with ascii "graphics" and all.. ...And batch is alot simpler and primitive than Sed. ;)
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.
Ofcourse, I vouldn't dream of even attempting to make anything like Sokoban in Batch. =)
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!
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.
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?
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..
The fact that it validates as W3C-approved HTML doesn't neccessarily mean that it will work on ANY browser (including Mozilla) ...
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.
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!
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.
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.
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!
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.
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
Yes. End of discussion.
Move along. Nothing to see here.
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.
MOD THIS UP! He just posted a new version on the site, this one includes :q :r :z :gN options!
:q quit :r restart level :z refresh screen :gN go to level N
d
#r COMMANDS
#r
#r
#r
#r
http://verde666.org/sed/sokoban/sokoban-v0.1.se
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.
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
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.
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?
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
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 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
...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.
Tried it under Sun and HP with noluck :(
for
"obsolete and should be removed from all unix distributions"
Perhaps if you READ THE DOCUMENTATION you wouldn't be posting to slashdot like an AOL user.
--Dan
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.