Skip to content

Instantly share code, notes, and snippets.

@wesjdj
Created May 1, 2013 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesjdj/5496704 to your computer and use it in GitHub Desktop.
Save wesjdj/5496704 to your computer and use it in GitHub Desktop.
ROMAN.pl
1 use 5.16.2;
2 use warnings;
3
4 use Test::More tests => 10;
5
6 is to_roman(1), "I", "1 gets converted to I";
7 is to_roman(2), "II", "2 gets converted to II";
8 is to_roman(3), "III", "3 gets converted to III";
9 is to_roman(4), "IV", "4 gets converted to IV";
10 is to_roman(5), "V", "5 gets converted to V";
11 is to_roman(6), "VI", "6 gets converted to VI";
12 is to_roman(7), "VII", "7 gets converted to VII";
13 is to_roman(8), "VIII", "8 gets converted to VIII";
14 is to_roman(9), "IX", "9 gets converted to IX";
15 is to_roman(10), "X", "10 gets converted to X";
16
17 sub to_roman {
18 my ($number) = @_;
19 return "III";
20 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment