The Goods
Lynn's Site w/Photo gallery
SemperToons
Dependable Computer Solutions
Outback Fireplaces
Client Info
IP: 38.107.191.110
Browser: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
Geek Stuff
I really enjoy coding perl whenever I can. I wouldn't consider myself an expert although I know enough to get around.
Here is the perl oneliner I used to webify this perl script:
perl -lwe 'while(<>){ chomp; s/</</g; s/>/>/g; s/\s+/ /g; print "$_<br />"; }' < ttgame.pl > ttgame.pl.ws
The script below is pretty fun to dink around with. I originally wrote it so that my nephew could practice his times tables.
#!/usr/bin/perl
#Script Name: ttgame.pl
#Author: Fastduke
#Date: 8JUL2003
#Description: Practice your times tables any number multiplied through 12
use strict;
use warnings;
use Term::ANSIColor;
my (
%answer, $value, $key, $count, $multiply_by,
$percent, $correct, $start, $end, $total
);
print "What number do you want to do your times tables up to 12 with (1- 12): ";
chomp( $multiply_by = <STDIN> );
if ( $multiply_by > 12) {
$multiply_by = 12;
}
$count = 1;
$correct = 0;
## Start timer ##
$start = time();
while ( $count <= 12 ) {
print "$multiply_by x $count = ";
chomp( $answer{ $multiply_by * $count } = <STDIN> );
if ( $answer{ $multiply_by * $count } == $multiply_by * $count ) {
$correct++;
}
$count++;
}
## Stop timer ##
$end = time();
## Results ##
foreach $key ( sort { $a <=> $b } keys %answer ) {
printf "Answer:%-5s Yours:%s\n", $key, $answer{$key};
}
$percent = ( ( $correct / 12 ) * 100 );
$total = $end - $start;
&print_results;
## This sub will use color for the results if your running linux and won't print crazy looking stuff if your in Win
sub print_results {
if ( $ENV{LOGNAME} ) {
print color("bold yellow");
printf "\nYou got %s correct! That is %.1f%s\n", $correct, $percent,
"%";
print "It took you $total seconds\n", color("reset");
}
else {
printf "\nYou got %s correct! That is %.1f%s\n", $correct, $percent,
"%";
print "It took you $total seconds\n";
}
}