SedSokoban 149
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."
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.
Re:No. (Score:2, Funny)
Undo (kind of) (Score:1)
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
Okaaaay. (Score:1, Funny)
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?
Batch-games. :) (Score:1)
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. =)
Drawback (Score:1)
Re:Drawback (Score:2, Interesting)
;)
(I probably shouldn't give him any ideas... )
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.
Re:Don't mistake the tool for the skill... (Score:1)
It's a slippery slope... (Score:4, Insightful)
Re:It's a slippery slope... (Score:1)
Like it is hard to make an Elite-clone run on anything as powerfull as an Enchanced iMac!! Nerd!
;)
Re:It's a slippery slope... (Score:1)
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
sed (Score:1)
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.
Re:sed (Score:1)
Re:sed (Score:1)
"Great! Now tell me again that history about when you died".
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:1)
Re:Ummm....What? (Score:5, Informative)
Re:Ummm....What? (Score:2)
Re:Ummm....What? (Score:1)
Maybe one could then assume that normally sed is used for regular expression scripts?
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?
Re:Ummm....What? (Score:1)
Slightly on a tangent, does anyone know of a help system for *nix similar to the old DOS help system
GNU's info?
Re:Ummm....What? (Score:2)
Re:Ummm....What? (Score:1)
Thanks again for your understanding
Re:Ummm....What? (Score:1)
Simplicity and ubiquity (Perl) versus lean, mean and obscure (sed).
Just the other day, I caught Verio using a Perl command call from an SSI include to get REMOTE_HOST functionality when it's actually less memory/cpu intensive with an almost exact sed search/replace expression.
Overgeneralization sure, but I see this with scripting at work also. But then, that was one of Perl's goals..
another side effect of hunger? (Score:1)
Re:OK - now for 'Quake' written in bash (Score:2)
/usr/local/bin/quake
#
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.
one word "REPTON" (Score:1)
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 !
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:1)
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:1)
TERM=xterm-color && export TERM
for bourne compatible shells... (oh and btw, that 2 minute timeout on /. sucks)
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)
Re:Finally... (Score:1)
Tried it out (Score:2, Interesting)
Re:Tried it out (Score:4, Funny)
Re:Tried it out (Score:1)
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.
Intercal (Score:1)
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...
Re:Doesn't work on Sun, either: (Score:1)
Mmm, Literacy. Was Re:Doesn't work on Sun, either: (Score:1)
Perhaps if you READ THE DOCUMENTATION you wouldn't be posting to slashdot like an AOL user.
--Dan
this'll show 'em (Score:1)
Tommorrow: Slashcode to be rewritten in sed.
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 =)
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)
It's OK as long as it isn't called TETRIS® (Score:1)
Me too, until I got a Cease and Desist order from the Tetris company!
As long as you don't call it TETRIS® [everything2.com], you should be fine. Games in and of themselves cannot be copyrighted, and falling tetrominoes [wikipedia.com] aren't patented in the US or the EU. Call it something weird like BinaryBlocks Game [evilpigeon.net] or freepuzzlearena [rose-hulman.edu] or something, and The Tetris Company will have no grounds for a trademark lawsuit. Sorry Henk...
Is sed Turing complete? (Score:1)
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.
Re:Is sed Turing complete? (Score:1)
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
Re:Proof that sed can in fact do everything... (Score:1)
Anyway, his implementation has the number of characters the sed-implementation allows minus three as a limit on the total number of states in the Turing machine, which mine doesn't.
SedSokoban? (Score:2)
Will conectiva (Score:1)
512 byte sokoban (Score:2)
how to fix errors on Solaris (Score:1, Interesting)
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}/;}'
This is sick (Score:1)
Oh my god, how I love it! Pure genius!
tetris / sokoban in VIM (Score:2)
Re:tetris / sokoban in VIM (Score:1)
Life is too short (Score:1)
Quake (Score:1)
Not the only sed game (Score:3, Informative)
Interesting game. (Score:1)
Sick programmers... (Score:1)
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...
insane... just insane.... (Score:1)
that ain't right (Score:2)
Cheats... (Score:1)
Level 1 [worldsinfinite.com]
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?
tiny solution contest (Score:1)
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 [verde666.org]
Can i mirror the image for you (Score:1)
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:Slashcode's HTML vs. Microsoft HTML (Score:1)
Re:Slashcode's HTML vs. Microsoft HTML (Score:1)
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.
Re:Slashcode's HTML vs. Microsoft HTML (Score:1, Offtopic)
Interesting. When I tried "www.microsoft.com [w3.org]", 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 [w3.org]", too. On the other hand, "msn.com [w3.org]" only produced 19 errors, of essentially the same type as "slashdot.org [w3.org]".
Re:Turing Complete? (Score:1)
Re:Turing Complete? (Score:1)
Re:Turing-complete text editors (Score:1)
As far as I understand Stallman's paper on the original Emacs [gnu.org], the original Emacs was written directly in TECO. The same paper appears to indicate that the first Emacs written in LISP was Multics EMACS.
Stallman writes [gnu.org] :-