master
matt lehning 2013-01-23 19:48:32 -05:00
parent 878eed7df7
commit e9d3036c73
2 changed files with 5 additions and 4 deletions

View File

@ -5,21 +5,21 @@ use DDG::Goodie;
triggers start => 'flip', 'coin';
handle remainder => sub {
return unless my ($a, $n) = $_ =~ /^(flip a coin|flip (/d{0,2) coins?)$/;
return unless my ($a, $n) = $_ =~ /^(flip a coin|flip (\d{0,2}) coins?)$/;
my @output;
my @ht = ('heads', 'tails');
my $flips = 1;
my $option = 2;
my $flip;
if($a = "flip a coin" || "heads or tails") {
if($a == "flip a coin" || "heads or tails") {
$n = 1;
}
if($n >= 1) {
for (1 .. $flips) {
$flip = int(rand(@choices));
for (1 .. $n) {
$flip = int(rand(@ht));
#$flip = $a[int rand($#a)];
push @output, $flip;
}

1
query.log Normal file
View File

@ -0,0 +1 @@
DDG/Goodie/Coin.pm did not return a true value at /home/matt/perl5/lib/perl5/App/DuckPAN/Cmd.pm line 21.