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."
Recently there has been some controversy over Slashdot's apparent disregard for browsers other than Konqueror or Netscape (*cough* IE *cough) ability to render the page, and some unfortunate crapfloods which would appear differently in different browsers.
The "editors" (I use the term loosely) of Slashdot appear to believe that Slashcode generates perfect HTML which any browser should render correctly, else the browser must be "buggy".
Slashcode's HTML Output
Just curious, I tried running the front page of Slashdot through the W3 validator to test this claim. The results were shocking.
Lets stick to the facts and drill down into the numbers. The W3 validator found HUNDREDS of errors on the very first page of Slashdot that you view every day. It terminated with the simple line Sorry, this document does not validate as HTML 3.2..
So, what is broken? Is it IE? Or is it the amateur garage-style open source code which is at fault? You be the judge.
Apparently, Slashcode follows the open source coding and testing ethic of "it worked for me". It's just too much to ask them to try to test their code for conformance and compliance, or even just try it on a variety of platforms.
Microsoft's HTML Output
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.
Conculsion
1. It may benefit the coders to attempt to adapt to some kind of acceptable process for designing, writing, and testing their own code. Perhaps some professional experience would be beneficial here. Certainly an accountability for certain quality standards must be implemented.
2. Perhaps Slashdot should consider switching to IIS 5.0 or .NET server and rewriting their code using a stable, reliable platform like Visual C++ or .NET. Perhaps only then will the browser compatbility issues will be resolved.
These are just suggestions. I am here to help.
there's no goatse in the entire article !!!
(NB: Autopr0n lauft wieder)
Smile, don't click...
(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
I think mods are really on crack these days : hope the last metamod will fuck them...
Oh wait, the last will be Taco and he's already fucked anybody (but Kathleen Fent) on this site...
Smile, don't click...
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.
Gay Niggers from Outer Space is a masterpiece of a film. No other film portraits emotions as majestically and stunningly since The Legend of Nigger Charley and Home Alone II. With a cast of all-star African niggers and a director with Kubrick potential, it is no wonder that Gay Niggers from Outer Space is marked the greatest film of all time.
From the very first scene where Gay Nigger Harris throws up on his own face and commits suicide, to the climactic scene where Nigger Ralph Nader and Nigger Humphrey Bogart fight over the last hashbrown and pick cotton til their noses bleed, Gay Niggers from Outer Space is the most magical portrayal of gay niggers open to the public. Containing elements of romance such as in Gone with the Wind -- where Gay Nigger Paul Bunyon makes a valentine out of his father's dandruff to fend off the maneating papayas; as well as elements of horror parallel to Silence of the Lambs -- Gay Nigger Arnold rapes a forest ranger and jumps into a volcano chased by a herd of buffalo mounted by Marilyn Mansons. Actors such as Nigger Van Harrison and Cup-Kake McNigger deliver remarkable performances, showing the skills that mainstream actors such as Ben Affleck and Freddy Krueger lack today. The screenplay and cinematography are outstanding, the lighting upon Nigger Paul Bunyon's ukulele symbolizes his grown attachment to the witch doctor that lives in the mountains and gives big gay niggers circumcisions in exchange for fluorescent light bulbs and deer meat
As stunning as all features of the films are, its poignant message still stands "Gay Niggers in boxers shorts have yellow teeth and eat custard pie." This film motivated me to become an actor, and to become a gay nigger. I give this film a 10/10
So is sed a turing complete language? Is anyone going to write a universal machine in sed?
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]
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.
Some guy wrote a crappy piece of script to make a crappy text-based game. Can somebody explain me how that is interesting, or even funny ? That plain sucks. Another slow day on /. Yawn!
This story has been posted purely to satisfy those who complain that Slashdot is not News for Nerds anymore.
So that's what conectiva employers do for a living. It's no surprise that their distribution is redhat with other name.
Will they put sedsokoban as a unique software on the next version of their distribution?
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.
SHIT ! I can't post some source code because of the lame lameness filter (solame in fact that it can't even filter itself in order to commit a satisfactory suicide...)
;;; trolltris.el -- elisp implementation of trolltris
;; Author: Glynn Clements
;; Created: 1997-08-13
;; Version 1.0
;; URL: ftp://sensei.co.uk/misc/tetris.el.gz
;; Tested with XEmacs 20.3-beta
Smile, don't click...
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... :)
gimme an S
gimme an L
gimme an A
gimme an S
gimme an D O T
what do you get?
.................................................
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!
only a dirty, shit-eating gnu hippy would be remotely impressed by this shoddy conversion of a shitty game.
update comments set karma=-1, reason='offtopic' where sid=26315
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..
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.