Cet assombrissement est soumis au nom de Paris.pm canal assombri.
YES, BUT NO...
This program is in fact two programs. 966 characters divided by two: 483.
Each of these program would fit nicely in 512 character. And tell me about
This entry is based on a suggestion made to me by Stéphane Payrard: "Why
don't you try a boustrophedonic form?", he asked. So I did. Since the term
is defined in "The new hackers's dictionary", I had every reason to do so.
The first line of the program is actually a small "bootstrap" that read the
rest of the file (here-document) and processes it before running the result.
SHOW ME SOME MORE!
Apart from using deprecated variables like $* ($# could have been put to more
work, had I had more inspiration), the first line treats the program to eval
differently depending on the presence of command-line arguments.
If there are, the bootstrap evals the text without modification. Else, the
program is treated as a boustrophedon, and every even line is reversed.
(All that is done in the END statement at the beginning.)
The rest of it is a gross use of comments and qquoted strings, combined with
the math needed for the fractals calculus and real to character screen-
coordinates conversion. A few features were added to fill the last blanks,
for example the use of the TPJ environment variable.
In interactive mode, the command are given in the following manner:
for example, x.404y-.35703 w5 h 5 i 108z.9A-.3 a .3 n 100
the whitespace is optionnal (this is a difference with command-line
BEHIND THE SCENES: MATHS!
Here is the meaning of each command (and variable: each command is in fact
a variable assignement):
- x: x-coordinate of the center of the screen (default: 0)
- y: y-coordinate of the center of the screen (default: 0)
- W: width of the output in characters (default: 79)
- H: height of the output in characters (default: 23)
- w: width of the printed screen (in real coordinates) (default: 2)
- h: height of the printed screen (in real coordinates) (default: 2)
- j: if non-zero, the printed image is the Julia set of parameter (x,y)
- X: x-coordinate of the center of the screen when displaying a Julia set
- Y: y-coordinate of the center of the screen when displaying a Julia set
- A: absolute rotation angle of the image (default: 0)
- a: relative rotation angle between the image and the next (default: 0)
- z: zooming factor between two images (default: 1)
- n: number of iterations for the calculus (default: 25)
- q: Quits the interactive program after next image.
Line 1: The variable $00 is assigned the rest of the program's content,
and eventually modified in the end.
Line 2: The default values are affected.
Line 3: The batch program reads its command-line parameters and affects the
Line 4: The interactive program creates its prompt (with each non-zero value
Lines 5-8: Part of the math for the iterations. Note that only half of the
lines are useful : the '#' splits them in two. (Line 8, it's the
second '#' that starts the comment.
Lines 9-11: The subroutine f contains all the necessary maths.
Line 11: The BEGIN at the end reads the values in the TPJ environnement
variable and puts them in @ARGV for processing by the program.
Please note that this BEGIN is executed after the previous END.
Line 12: s/// and y/// convert the prompt from garbage to human-readable
Lines 6, 8 and 10 are perfectly symmetric, which is some kind of waste of
characters (imagine of much could have been squeezed out to fit into
For other ASCII-art animations, please refer to:
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||