aboutsummaryrefslogtreecommitdiff
path: root/ponysaylist.pl
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-01 03:33:30 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-01 03:33:30 +0200
commit70c27ca36f696b12012d7f47ac3071f747b95207 (patch)
tree7fd090244f918246f179becb767511fc8afc26fd /ponysaylist.pl
parente5b783e52858ae73d26c21464952323b9e3f320a (diff)
downloadponysay-70c27ca36f696b12012d7f47ac3071f747b95207.tar.gz
ponysay-70c27ca36f696b12012d7f47ac3071f747b95207.tar.bz2
ponysay-70c27ca36f696b12012d7f47ac3071f747b95207.zip
some edits
Diffstat (limited to 'ponysaylist.pl')
-rwxr-xr-xponysaylist.pl41
1 files changed, 0 insertions, 41 deletions
diff --git a/ponysaylist.pl b/ponysaylist.pl
deleted file mode 100755
index 2004484..0000000
--- a/ponysaylist.pl
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env perl
-
-# ponysaylist
-# Prints a list of ponies in columns
-#
-# Licensed under WTFPL
-# See COPYING for details
-
-# Author: Mattias Andrée, maandree@kth.se
-# spider-mario
-
-
-use strict;
-use warnings;
-use utf8;
-use feature qw(say);
-use integer;
-use List::Util qw(max);
-
-my $scrw = shift @ARGV // 1;
-
-#for (@ARGV) {
-# # Format names from pony names
-# s/(?<=[a-z])(?=[A-Z])/ /;
-# s/_(.*)/\t($1)/;
-#}
-
-my $maxw = max 1, map {length} @ARGV;
-
-my $cols = max 1, (($scrw + 2) / ($maxw + 2));
-
-my @list = map {sprintf "%-${maxw}s", $_} @ARGV;
-
-my $rows = (@list + $cols - 1) / $cols;
-
-my @rowlist;
-for my $i (0 .. $#list) {
- push @{$rowlist[$i % $rows]}, $list[$i];
-}
-
-say join ' ', @$_ for @rowlist;