El código
Using perl Syntax Highlighting
- #!usr/bin/perl
- #ASCII Art 0.1
- #Coded By Doddy H
- use List::Util "max";
- use Time::HiRes "usleep";
- my %letras = (
- a => "
- @
- @
- @ @
- @ @
- @ @
- @ @
- @@@@@
- @ @
- @ @
- ",
- b => "
- @@@@
- @ @
- @ @
- @ @
- @@@@
- @ @
- @ @
- @ @
- @@@@
- ",
- c => "
- @@@@
- @ @
- @
- @
- @
- @
- @
- @ @
- @@@@
- ",
- d => "
- @@@@
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @@@@
- ",
- e => "
- @@@@@
- @
- @
- @
- @@@@
- @
- @
- @
- @@@@@
- ",
- f => "
- @@@@@
- @
- @
- @
- @@@@
- @
- @
- @
- @
- ",
- g => "
- @@@@
- @ @
- @
- @
- @ @@@
- @ @
- @ @
- @ @@
- @@@ @
- ",
- h => "
- @ @
- @ @
- @ @
- @ @
- @@@@@@
- @ @
- @ @
- @ @
- @ @
- ",
- i => "
- @
- @
- @
- @
- @
- @
- @
- @
- @
- ",
- j => "
- @
- @
- @
- @
- @
- @
- @ @
- @ @
- @@
- ",
- k => "
- @ @
- @ @
- @ @
- @@
- @@
- @ @
- @ @
- @ @
- @ @
- ",
- l => "
- @
- @
- @
- @
- @
- @
- @
- @
- @@@@@
- ",
- m => "
- @ @
- @ @
- @@ @@
- @@ @@
- @ @ @ @
- @ @ @ @
- @ @ @
- @ @ @
- @ @
- ",
- n => "
- @ @
- @@ @
- @@ @
- @ @ @
- @ @ @
- @ @ @
- @ @@
- @ @@
- @ @
- ",
- o => "
- @@@@
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @@@@
- ",
- p => "
- @@@@@
- @ @
- @ @
- @ @
- @@@@@
- @
- @
- @
- @
- ",
- q => "
- @@@@
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @ @
- @ @@
- @@@@
- @
- ",
- r => "
- @@@@@
- @ @
- @ @
- @ @
- @@@@@
- @ @
- @ @
- @ @
- @ @
- ",
- s => "
- @@@
- @ @
- @
- @
- @@@
- @
- @
- @ @
- @@@
- ",
- t => "
- @@@@@
- @
- @
- @
- @
- @
- @
- @
- @
- ",
- u => "
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @@@@
- ",
- v => "
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @ @
- @
- @
- ",
- W => "
- @ @
- @ @
- @ @ @
- @ @ @
- @ @ @
- @ @ @ @
- @ @ @ @
- @ @
- @ @
- ",
- x => "
- @ @
- @ @
- @ @
- @ @
- @
- @ @
- @ @
- @ @
- @ @
- ",
- y => "
- @ @
- @ @
- @ @
- @ @
- @
- @
- @
- @
- @
- ",
- z => "
- @@@@@@@
- @
- @
- @
- @
- @
- @
- @
- @@@@@@@
- "
- );
- head();
- print "\n\n[+] Text : ";
- chomp( my $text = <stdin> );
- print "\n\n" . artnow($text) . "\n";
- copyright();
- sub artnow {
- my $target = shift;
- my $fondo = " ";
- my $espacio = 0;
- my $lugar;
- my @lotengo;
- my $tipox = $letras{"a"};
- my @lineas = split /\n/, $tipox;
- $altura = @lineas + 1;
- $anchura = max map { length $_ } @lineas;
- for ( 1 .. $altura ) {
- push @lotengo, $fondo x ( ( $anchura + $espacio ) * length $target );
- }
- for my $letra ( split //, $target ) {
- my @lineas = split /\n/, $letras{$letra};
- for my $i ( 0 .. $altura - 1 ) {
- ( my $plan = $lineas[$i] ) =~ s/ /$fondo/g;
- $plan = $fondo x $anchura if not $plan;
- substr( $lotengo[$i], $lugar, length $plan ) = $plan;
- }
- $lugar += $anchura + $espacio;
- }
- return ( join "\n", @lotengo );
- }
- sub head {
- my @logo = (
- "#=============================================#", "\n",
- "# ASCII Art 0.1 #", "\n",
- "#---------------------------------------------#", "\n",
- "# Written By Doddy H #", "\n",
- "# Email: lepuke[at]hotmail[com] #", "\n",
- "# Website: doddyhackman.webcindario.com #", "\n",
- "#---------------------------------------------#", "\n",
- "# Thanks to : reLlene,MARKO,explorer #", "\n",
- "# The End ? #", "\n",
- "#=============================================#", "\n"
- );
- print "\n";
- marquesina(@logo);
- }
- sub marquesina {
- #Effect based in the exploits by Jafer Al Zidjali
- my @logo = @_;
- my $car = "|";
- for my $uno (@logo) {
- for my $dos ( split //, $uno ) {
- $|++;
- if ( $car eq "|" ) {
- mostrar( "\b" . $dos . $car, "/" );
- }
- elsif ( $car eq "/" ) {
- mostrar( "\b" . $dos . $car, "-" );
- }
- elsif ( $car eq "-" ) {
- mostrar( "\b" . $dos . $car, "\\" );
- }
- else {
- mostrar( "\b" . $dos . $car, "|" );
- }
- usleep(40_000);
- }
- print "\b ";
- }
- sub mostrar {
- print $_[0];
- $car = $_[1];
- }
- }
- sub copyright {
- print "\n\n";
- marquesina("-- == (C) Doddy Hackman 2012 == --");
- print "\n\n";
- <stdin>;
- exit(1);
- }
- #The End ?
Coloreado en 0.008 segundos, usando GeSHi 1.0.8.4
Ejemplo de uso
- Código: Seleccionar todo
r00t ~ # art.pl
#=============================================#
# ASCII Art 0.1 #
#---------------------------------------------#
# Written By Doddy H #
# Email: lepuke[at]hotmail[com] #
# Website: doddyhackman.webcindario.com #
#---------------------------------------------#
# Thanks to : reLlene,MARKO,explorer #
# The End ? #
#=============================================#
[+] Text : kacked
@ @ @ @@@@ @ @ @@@@@ @@@@
@ @ @ @ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @
@@ @ @ @ @@ @ @ @
@@ @ @ @ @@ @@@@ @ @
@ @ @ @ @ @ @ @ @ @
@ @ @@@@@ @ @ @ @ @ @
@ @ @ @ @ @ @ @ @ @ @
@ @ @ @ @@@@ @ @ @@@@@ @@@@
-- == (C) Doddy Hackman 2012 == --