- or download this
# s#((?{$a.=$+})\s?(\S*)\s?)*#$a=~s/Z/ /g;$a#see
- or download this
( $width, $height ) = split /x/, shift || "19x20";
- or download this
$x_max = 10 + 10 * $width;
$y_max = 20 + 10 * $height;
- or download this
@m = ( ( 31, (15) x ( $width - 1 ) ) x $height, (31) x $width );
- or download this
# 8
# 1 2
...
# v u d r l
# 1 1 1 1 1
- or download this
$m[$c] |= 16,
- or download this
!(
- or download this
@a = grep !( $m[ $c + $$_[0] ] & 16 + $| * $$_[1] ),
#left
...
# down
[ -$width, 2 ]
)
- or download this
? $c = pop @p :
- or download this
${
( $i, $j ) = @{ $a[ rand @a ] };
- or download this
$m[$c] &= ~ (8 / $j);
- or download this
push @p, $c;
- or download this
$m[ $c += $i ] &= ~$j;
- or download this
++$counter - $height * $width + $height ||
map $_ &= 15, @m, splice(@p), $c = $| = 1
}
- or download this
#print"\ec",
# map$_%9?($_-$c?$m[$_]&2?_:$":o).($m[$_]&8?"|":_):$/,1..72
- or download this
until $| & $c + 2 > $width * $height;
- or download this
$space = $x_max - 4 * int $x_max / 4;
- or download this
$image_size = ( $x_max + $space ) * $y_max;
- or download this
$image = pack "x" x ( ( $x_max + $space ) * $y_max );
- or download this
sub line {
my ( $x1, $x_len, $y1, $y2, $e ) = @_;
- or download this
@a = sort { "000$a" <=> "000$b" } $y1, $y2 || $y1;
for ( $a[0] .. $a[1] ) {
- or download this
$s = ( $y_max - $_ ) * ( $x_max + $space ) + $x1;
vec( $image, $_, 8 ) = $e || 2 for $s .. $s + $x_len - 1;
}
}
- or download this
sub t {
$a = shift;
$x = 10 * ( $a % $width );
$y = 10 * ( 2 + int $a / $width )
}
- or download this
# top
line 9, $x_max - 20, 10;
...
line 9, 1, 10, $y_max - 10;
# right
line $x_max- 11, 1, 10, $y_max - 10;
- or download this
map {
- or download this
t $_;
- or download this
if ( $_ % $width ) {
- or download this
$m[$_] & 2 ? line $x - 1, 11, $y : "";
- or download this
$m[$_] & 8 ? line $x + 9, 1, $y - 10, $y : "";
}
- or download this
} 0 .. -1 + $width * $height;
- or download this
open( FH, ">al.avi" );
binmode FH;
select FH;
# a space saver
$LIST = "LIST";
- or download this
print pack "V*", /\d/ ? $_ : unpack "V*", $_ for
- or download this
"RIFF",
# length of file (header length + data length + index length)
...
# length of avi header:
# (40) + length of color table (1024)
1064,
- or download this
40,
$x_max,
...
0,
$image_size,
(0) x 4,
- or download this
pack(
( "H" x 1024 ),
"f", "f", "f", 0, "a"
),
- or download this
# "JUNK",
# <length of junk to boundary>,
# <null bytes to boundry>
- or download this
$LIST,
- or download this
( 4 + ( $image_size + 8 ) * $num_frames ),
"movi";
- or download this
map {
- or download this
print STDOUT ++$G, $/;
- or download this
t $previous|| 1;
- or download this
$left = $x;
- or download this
$top = $y;
- or download this
t $_;
$right = $x;
- or download this
if ( $left > $x ) { $right = $left; $left = $x }
- or download this
line $left+ 2, 5 + $right - $left,
( $top < $y ? $top : $y ) - 7,
( $top < $y ? $y : $top ) - 3,
- or download this
1;
$previous = $_;
- or download this
print "00db" . pack( "V", $image_size ) . $image
} @p, ( -1 + $width * $height ) x 3;
- or download this
print "idx1" . pack "V", 16 * $num_frames;
$o = 4;
- or download this
for ( 1 .. $num_frames ) { print "00db" . pack "VVV", 16, $o, $image_s
+ize; $o += $image_size + 8 }