Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Am I doin it rite?

Name: Anonymous 2007-03-08 16:11 ID:ko8I8fKq


#!/usr/local/bin/python
inc=0
length=int(raw_input("How long is looooooongcat?\n"))
print "    ^_____^            \n"
print "   /       \           \n"
print "  |  #    # |          \n"
print "  \     @   |          \n"
print "   \   _|_ /           \n"
print "   /       \________   \n"
print "  / ________  ___   \  \n"
print "  | ________   \ \__/  \n"
print "   |        \__/       \n"
while inc<length:
    print "    |        |        \n"
    inc=inc+1
print "   /          \        \n"
print "  /   ______   \       \n"
print "  |  /      \  |       \n"
print "  | |        | |       \n"
print " /  |        |  \      \n"
print " \__/        \__/      \n"

Name: Anonymous 2007-03-15 15:15 ID:9r+M76Oj

Needs more PERL-ish. >>42 is way to pythonic.


#!/usr/bin/env perl
use strict; #follow best practices
use warnings;
print "How long is looooooongcat?\n";
chomp(my $l = <STDIN>);

my $c = "    ^_____^            \n   /       \          
  |  #    # |         
  \     @   |          \n   \   _|_ /           \n   /       \________  
  / ________  ___   \  \n  | ________   \ \__/  \n   |        \__/      
    |        |         \n   /          \        \n  /   ______   \      
  |  /      \  |       \n  | |        | |       \n /  |        |  \     
 \__/        \__/      \n";

my @cat_part = map { (/(^\s+\|\s+\|\s+$)/) ?
            [$_, sub{ print @_ for 1..$l }]
            : [$_, sub{ print @_ } ];
} split "\n", $c;

foreach (@cat_part) {
    my $s = pop @{$_};
    &$s(@{$_}, "\n");
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List