support "dices" spelling for dice trigger

fixes #1255 (except for not converting "two" into 2)
master
marianosimone 2016-02-28 20:05:34 +00:00
parent 5f5c510480
commit a2c3f19b9d
2 changed files with 15 additions and 1 deletions

View File

@ -76,7 +76,7 @@ handle remainder_lc => sub {
my $heading = "Random Dice Roll";
my $total; # total of all dice rolls
foreach (@values) {
if ($_ =~ /^(?:a? ?die|(\d{0,2})\s*dic?e)$/) {
if ($_ =~ /^(?:a? ?die|(\d{0,2})\s*dic?es?)$/) {
# ex. 'a die', '2 dice', '5dice'
my @output;
my $sum = 0;

View File

@ -30,6 +30,20 @@ ddg_goodie_test(
}
}
),
'throw dices' => test_zci(
qr/^., .$/,
structured_answer => {
id => 'dice',
name => 'Answer',
data => '-ANY-',
templates => {
group => 'text',
options => {
subtitle_content => 'DDH.dice.subtitle_content'
}
}
}
),
'roll dice' => test_zci(
qr/^., .$/,
structured_answer => {