Added first version of roman numerals

master
mr.Shu 2011-11-29 23:14:30 +00:00
parent 1ba9e13433
commit ea56899f03
2 changed files with 26 additions and 0 deletions

21
roman/goodie.pl Normal file
View File

@ -0,0 +1,21 @@
use Roman;
if (!$type && $q_check =~ /^(?:(?:roman|arabic))?\s*([mdclxvi]+)$/i) {
$answer_results = arabic $1;
if ($answer_results) {
$answer_type = 'roman';
$type = 'E';
}
} elsif (!$type && $q_check =~ m/^roman ([0-9]+)$/i) {
$answer_results = uc(roman($1));
if ($answer_results) {
$answer_type = 'roman';
$type = 'E';
}
}

5
roman/queries.txt Normal file
View File

@ -0,0 +1,5 @@
roman xii
roman mmcml
roman 2344
arabic cccxlvi
mcmiv