Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(kata).
- -export([call/2]).
- point(0) -> love;
- point(1) -> 15;
- point(2) -> 30;
- point(3) -> 40.
- call(S,R) when S>=3,R>=3 ->
- case S-R of
- 2 -> {game,server};
- 1 -> {adv,server};
- 0 -> deuce;
- -1 -> {adv,receiver};
- -2 -> {game,receiver}
- end;
- call(4,_) -> {game,server};
- call(_,4) -> {game,receiver};
- call(S,R) -> {point(S),point(R)}.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement