%rome.erl -module(rome). -export([rome/3]). rome(99, L, A) -> "exit"; rome(0, L, A) -> L; rome(Number, L, A) -> case Number > 10 of true -> rome(Number-10, "X "++L, A); false -> rome(0, L++" "++element(Number rem 11, A), A) end.
A = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"}. c(rome). rome:rome(38, "", A).