1#!/usr/local/bin/perl
2# /----------\
3# |robot say!|
4# \---\ /----/
5#     /
6# [-]
7# (+)=C
8# | |
9# OOO
10# WHAT YOU SAY?
11# this program makes a robot
12# the robot says what you tell it to on the command line
13# you need to escape chars, this program isn't very smart...
14# bad perl code at it's best!
15
16# robot finds kitten
17# http://www.robotfindskitten.org
18# version 0.1 Adam Northern
19# anorthern@redhotlunix.com
20
21$robot[0] = " [-]  ";
22$robot[1] = " (+)=C";
23$robot[2] = " | |  ";
24$robot[3] = " OOO  ";
25
26$whatToSay = join(" ", @ARGV);
27$amountOfChars = length($whatToSay);
28
29$text[0] = ' /';
30for($i = 0; $i < $amountOfChars; $i++) {
31	$text[0] .= '-';
32}
33$text[0] .= '\\';
34$text[1]  = ' |';
35$text[1] .= $whatToSay;
36if (length($whatToSay) != $amountOfChars) {
37	for ($i = 0; $i < $amountOfChars; $i++) {
38		$text[1] .= " "
39	}
40}
41$text[1] .= '|';
42$text[2] = ' \\---\\ /';
43for($i = 6; $i < $amountOfChars; $i++) {
44	$text[2] .= '-';
45}
46$text[2] .= '/';
47$text[3] = '     /';
48for($i = 0; $i < 4; $i++) {
49	$text[$i+4] = $robot[$i];
50}
51for($i = 0; $i < 8; $i++) {
52	print $text[$i] . "\n";
53}
54
55