#!/usr/bin/perl -w use strict; my @template = ( "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "1` |. |. |. |", "2 |. #. |. |", "3 |. ##. |. |", "4 |. ###. |. |", "5 |. ####. |. |", "6 |. #####. |. |", "7 +Y+ |. ######. |. + |", "8 Y+Y |. #######. |. + |", "9 +Y+ |. ########. |. + |", "a |. #########. |. |", "b |. ##########. |. |", "c |. ###########. |. |", "d |. ############. |. |", "e |. #############. |. |", "f______________|._##############.______________|.______________|", "0.........................######................................", "1 |. ######. |. |", "2 |. ######. |. |", "3 |. ######. |. |", "4 |. ######. |. |", "5 |. ######. |. |", "6 |. ######. |. |", "7 |. ######. # # ### |. |", "8 |. ######. # # # # |. |", "9 |. ######. # # ### |. |", "a |. ######. # # # |. |", "b |. ######. ### # |. |", "c |. ######. |. |", "d |. ######. |. |", "e |. ######. |. |", "f______________|._________######.______________|.______________|", "0.........................######................................", "1 |. ######. |. |", "2 |. ######. |. |", "3 |. ######. |. |", "4 |. ######. |. |", "5 |. ######. |. |", "6 |. ######. |. |", "7 |. ######. |. |", "8 |. ######. |. |", "9 |. ######. |. |", "a |. ######. |. |", "b |. ######. |. |", "c |. ######. |. |", "d |. ######. |. |", "e |. ######. |. |", "f______________|._________######.______________|.______________|", "0.........................######................................", "1 |. ######. |. |", "2 |. ######. |. |", "3 |. ######. |. |", "4 |. ######. |. |", "5 |. ######. |. |", "6 |. ######. |. |", "7 Y |. ######. |. +X+ |", "8 X |. ######. |. X+X |", "9 |. |. |. +X+ |", "a |. |. |. |", "b |. |. |. |", "c |. |. |. |", "d |. |. |. |", "e |. |. |. |", "f______________|.______________|.______________|.______________|", ); unless( $#ARGV == 1 && $ARGV[0] =~ /^(\d+)$/ && $ARGV[1] =~ /^(\d+)$/ ) { die "$0 \n"; } my $template_width = length($template[0]); my $template_height = $#template + 1; for(my $y = 0; $y < $ARGV[1]; $y++) { my $t = $template[$y % $template_height]; for(my $x = 0; $x < $ARGV[0]; $x += $template_width) { if( $y % $template_height == 2 ) { my $label = "(" . ($y - 2) . ",$x)"; substr($t, 2, length($label)) = $label; } if( $x + $template_width > $ARGV[0] ) { $t = substr($t, 0, $ARGV[0] % $template_width); } print $t; } print "\n"; }