Re: Gantt Golf
[email protected] ("Riley")
| Newsgroups | perl.golf |
|---|---|
| Organization | Legalbill |
| Message-ID | <[email protected]> |
> map{split/
>
/;$i=shift@_;$l=shift@_;my$m;map$m.="-",1..$l;map{$s[$i]=$e[$_]if($e[$_]>$s[
> $i])}@_;my$n;map$n.=" ",1...$s[$i];$e[$i]=$l+$s[$i];print"$i
$n$m\n"}<STDIN>
I found a few more shortcuts and ended with the following:
map{split;$i=shift@_;$l=shift@_;my$s;map{$s=$e[$_]if($e[$_]>$s)}@_;$e[$i]=$l
+$s;print$i,(map" ",0..$s),(map"-",1..$l),"\n"}<>
...But this is still twice as long as the leader...
On a side note, I am using ActivePerl, and am having problem using switches.
It seems as though -n and -p would be extremely useful here, but I always
get errors when I try via either a script or from the command line. Has
anyone dealt with this?
-Riley