I personally believe that Perl is already known to have a fun side of its community culture, as opposed to its natural pragmatic nature and as exemplified by games like golf and ob-fu, although:
- many respected hackers agree that those aspects did and do more bad to Perl's name than good;
- some of them, especially the second one I mentioned are far from being exclusive of Perl.
Whatever, in my Insane™ ;) wanderings through "Saint Wikipedia" I just stumbled upon the surrealist movement's game of Exquisite Corpse which, to put it as briefly as possible consists of the literary composition of texts by many persons each of which will only see the last line of what the previous one wrote or be given a basic syntactic structure to start with his or her part. Alternatively, the same term describes the corresponding graphical game in which each individual in turn draws one piece of a bigger figure folding the paper so that only a minimal portion of it will be visible.
Now, I had the Insane™ ;) idea of doing the same in Perl: of course some more care than with a generic natural language should be taken to link one piece of the program to the other. Also: should each "piece" work as of its own? I don't think it necessarily should, or it would be too restrictive wrt the surrealist POV which is the common background under which one would possibly want to play this game.
For the moment I propose that one would either give:
- the last statement of his piece, and if there are unclosed curlies, then specify how many of them or
- all the variables used thus far, implicitly or explicitly, and how many times, so to allow for "non linear" continuation.
(As far as the second point is concerned, it means that a player may "substitute" the nth occurrence of a variable with... whatever he likes, in the spirit of the game.)
So does somebody want to (try to - it's an experiment, after all!) play with me? From a minimal snippet of code of mine to remember how "to do something" with comments removed - running under strict,warnings and 5.010 - one unclosed curly:
14 33 266 corpse.pl
C:\temp>tail -n 3 corpse.pl
Update: one monk (whose name I will substitute to this anonymous mention if he likes to) sent me a /msg saying:
I personally believe that your starting code is rather unfortunate - it's hard to think of a program that does something useful and does a substitution in the last line without using its result... maybe pick something simpler for a start?
(additional emphasis by me)
I have two considerations to make in reply:
- of course is it hard: but if it were not, then it wouldn't be much fun. It's not dissimilar from drawing the face of a man and just showing two little parallel ticks which should mark the border of his neck: to the next person, they may be quite about everything. If one put there e.g. a bowtie, then it would be "obvious" what to draw next, and much less surreal. Also, I claimed that this is an adaptation of a minimal example note I keep, so it should be supposed to be somewhat useful, but that may have not been my intention to start with: I actually decided to show that particular "line" while I had the one in which I used the results and I may have shown that instead. But then you would have "only" had to think of a way to create the results first... again, much less fantasy, much less randomness.
- Said all this, I realize that programming is not just the same as drawing on a piece of paper or a natural language: the code must compile too! So given that AFAIK this is the first attempt at such a game, I'm all open to suggestions and modifications as far as rules are concerned as the game itself goes by. I see I have a reply, in fact, but I'm literally falling asleep now. I'll read it better (or at all, which is something I'm not sure I could guarantee in this very moment...) tomorrow morning.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||