Slashdot Log In
SedSokoban
Posted by
michael
on Thu Mar 21, 2002 03:32 AM
from the things-that-should-be-illegal-but-aren't dept.
from the things-that-should-be-illegal-but-aren't dept.
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 discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
One question: (Score:1, Insightful)
(This was the case in the original, or at least the older, Sokoban for XTs.)
No. (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.
Parent
Re:No. (Score:2, Funny)
Screenshot Mirror (Score:1)
http://www.zianet.com/endikos/sedsokoban.png [zianet.com]
Re:Screenshot Mirror (Score:4, Funny)
*DING!*DING!*DING! - We have a Winner!
For a 2kb .png [verde666.org] that's the
worst attempt at cheap karma this week.
//ct
Parent
Don't mistake the tool for the skill... (Score:5, Insightful)
That doesn't mean nail files are any more useful than we thought.
Re:Don't mistake the tool for the skill... (Score:3, Interesting)
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.
It's a slippery slope... (Score:4, Insightful)
Ummm....What? (Score:3, Interesting)
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.
Re:Ummm....What? (Score:5, Informative)
If you really don't know what SED is, then Google's your friend : http://directory.google.com/Top/Computers/Softwar
Parent
Re:Ummm....What? (Score:3, Informative)
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.
Re:Ummm....What? (Score:5, Informative)
Parent
Re:Ummm....What? (Score:2)
Re:Ummm....What? (Score:4, Informative)
If you want to know more about sed, look at the man page, available http://linux.ctyme.com/man/man2377.htm [ctyme.com]
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?
Parent
Re:Ummm....What? (Score:2)
Yes, but... (Score:2, Funny)
Not bad (Score:2, Interesting)
(this is how it works [inwind.it])
An excellent unix game package.. (Score:2, Interesting)
If you haven't heard of or tried it, [and like this sort of game], be sure to also look into
rocksndiamonds [artsoft.org], 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.
Re:one word "REPTON" (Score:2)
Sokoban in Nethack (Score:5, Informative)
Re:Sokoban in Nethack (Score:3, Insightful)
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 [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.
Re:Sokoban in Nethack (Score:2)
Heck, when you first encounter it, you don't even know it's a Sokoban puzzle. You just find these goofy walls. It's only after carefully exploring and mapping the free and open areas and the wall materials that you might see your map as something else. Finally you can start working out on paper what you need to do.
I played this on an Apple II, and it's still available in the Infocom collection. Heck, play it on your Palm Pilot.
Re:Sokoban in Nethack (Score:2)
To elaborate further, nethack is a latter-day version of hack, which in turn was a descendant of the original rogue [wichman.org]. (Which, as the man said, is an ASCII/curses based RPG.)
while we're at it: color in freebsd nethack? (Score:2)
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!)
Re:while we're at it: color in freebsd nethack? (Score:2)
Right, enough silly banter. Pay attention:
Try this: (in bourne shell derivatives)
TERM-xterm-color && export TERM
Or this: (if you use the csh dialect)
setenv TERM xterm-color
As you will notice, more apps will be in color now, like mutt et al... Oh, you can have your colored ls(1) too. Check google on how to set that up.
Re:while we're at it: color in freebsd nethack? (Score:2)
It's not my fault!
The boss just won't spring for a 3x3 shelf of VT100's with a wrist-mount inertial switch to connect the keyboard, so I'm stuck with xterms, the *real* reason for using X.
>I usually would point you to the documemtation,
Been there, done that. TERM was already xterm-color. This now works, but it wasn't before. It may be that all the colors were used up (I have my drive in a loaner laptop, and only get 8 bit--and it's not worth hunting down an xf86config for the few days involved), or there may have bveen another funky interaction going on.
But thanks.
hawk
The best graphical version of Nethack... (Score:2)
Finally... (Score:2, Funny)
Tried it out (Score:2, Interesting)
Re:Tried it out (Score:4, Funny)
Parent
Towers of Hanoi & Mandelbrot for vim (Score:2)
Now what we need is... (Score:4, Interesting)
Consider the case of Andreas Junghanns, who wrote Rolling Stone, the world's top machine Sokoban solver [ualberta.ca], 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.
A wise man once said... (Score:5, Funny)
"Just because I can drive a car with my feet - doesn't make it a good fucking idea".
Under OS X (Score:4, Interesting)
- sed: 2266:
./sokoban.sed: unexpected EOF (pending }'s)
Once again, GNU tools rule over BSD tools. Well, for gaming, anyway.Doesn't work on Sun, either: (Score:3, Interesting)
Too many {'s$
Bleh...
Never underestimate a scripting language... (Score:2)
Perltris [seanadams.com]
Re:Never underestimate a scripting language... (Score:2)
So Tetris is kindof my "Hello World" when learning a new language. I don't think I'll try to write it in sed though.
Re:Never underestimate a scripting language... (Score:2)
strange hacks hall of fame? (Score:2, Interesting)
Proof that sed can in fact do everything... (Score:2, Interesting)
Oh, ofcourse, the sed Turing Machine [student.kun.nl] 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
SedSokoban? (Score:2)
512 byte sokoban (Score:2)
tetris / sokoban in VIM (Score:2)
Not the only sed game (Score:3, Informative)
that ain't right (Score:2)
Talk about fast progress... (Score:2)
When I went here [verde666.org] 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.
Re:Slashcode's HTML vs. Microsoft HTML (Score:1)
Re:Drawback (Score:2, Interesting)
;)
(I probably shouldn't give him any ideas... )
Re:this'll show 'em (Score:2, Insightful)
Hey, let's not be unfair. At least we Perl users have terminal control libraries [cpan.org] 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 =)
Re:OK - now for 'Quake' written in bash (Score:2)
/usr/local/bin/quake
#