in reply to CAN YOU FIGURE THIS OUT?
Using Cody Pendants post as inspiration. Implementing the Kelvin / Fahrenheit/Celsius conversion functions and better presentation is left as an exercise for the reader...
#! /usr/bin/perl use strict; use warnings; kelvin (@ARGV); sub kelvin { my $start = $_[0]; my $end = $_[1]; my $inc = $_[2]; if (($start > 0) and ($start < $end)) { print "Fahrenheit Celcius\n"; my $loop = $start; while ($loop < $end) { print $loop, "\n"; $loop = $loop + $inc; } } else { die ("You entered bad arguments dumbass!"); } }
Or just mess with his head...
k2 (@ARGV); sub k2 {s{}{$_[0]-$_[2]}e;while( $_[0]>=0&&$_[0]<$_[1]&&s>([\d.]+)> $1<$_[1]?$1+$_[2]:''>e){print+qq +$_\n+};!$_||die ("Bad Params!")}
|
---|