Last active
May 30, 2017 00:03
-
-
Save haru01/632acb91eb7ab6d41a30ef1b2fa16949 to your computer and use it in GitHub Desktop.
step4 V
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package roman | |
func ToRoman(in uint16) string { | |
numbers := []struct { | |
arabian uint16 | |
roman string | |
}{ | |
{1, "I"}, | |
{5, "V"}, | |
} | |
for _, n := range numbers { | |
if n.arabian == in { | |
return n.roman | |
} | |
} | |
return "_" // TODO | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment