diff options
author | Guillermo Ramos | 2019-05-30 22:17:56 +0200 |
---|---|---|
committer | Guillermo Ramos | 2019-05-30 22:18:03 +0200 |
commit | cdd1b6a4c2f7407f5393a0dc88f35a126be96213 (patch) | |
tree | 3ed16fee89fd212ead81785b7608b95a7072246b /010/ch1.pl | |
parent | 4493a71f62adec164d5184a2982cd568d72de5a4 (diff) | |
download | perlweekly-cdd1b6a4c2f7407f5393a0dc88f35a126be96213.tar.gz |
[010] Format
Diffstat (limited to '010/ch1.pl')
-rwxr-xr-x | 010/ch1.pl | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -31,6 +31,7 @@ if ($ARGV[0] eq "--test") { # roman -> arabic sub decode { my @roman = split //, shift; + # Decimal value of each roman symbol my %dec = ( M => 1000, @@ -65,6 +66,7 @@ sub encode { die "ERROR: Unable to encode numbers bigger than 9999" if $_[0] > 9999; my @arabic = split //, shift; + my @symbols = ("I", "V", "X", "L", "C", "D", "M"); my @roman; # Return value (roman symbols) |