Fixed terminology from Yaku to Han

This commit is contained in:
Correl Roush 2012-05-04 13:49:13 -04:00
parent 6a030241e3
commit 3cadb3bdbc
2 changed files with 9 additions and 9 deletions

View file

@ -50,21 +50,21 @@ nearest(Num, To) ->
Num - (Num rem To) + To. Num - (Num rem To) + To.
score(_Fu, Yaku, Limit) when (Yaku >= 5) and (Limit == true) -> score(_Fu, Han, Limit) when (Han >= 5) and (Limit == true) ->
if if
Yaku < 6 -> Han < 6 ->
2000; 2000;
Yaku < 8 -> Han < 8 ->
3000; 3000;
Yaku < 11 -> Han < 11 ->
4000; 4000;
Yaku < 14 -> Han < 14 ->
6000; 6000;
true -> true ->
8000 8000
end; end;
score(Fu, Yaku, Limit) -> score(Fu, Han, Limit) ->
Score = nearest(Fu * round(math:pow(2, 2 + Yaku)), 100), Score = nearest(Fu * round(math:pow(2, 2 + Han)), 100),
if if
Limit and (Score > 2000) -> Limit and (Score > 2000) ->
2000; 2000;

View file

@ -60,8 +60,8 @@ nearest_test_() ->
[?_assertEqual(riichi:nearest(Val, 10), 80) || Val <- lists:seq(71,80)]. [?_assertEqual(riichi:nearest(Val, 10), 80) || Val <- lists:seq(71,80)].
score_yaku_limit_test_() -> score_yaku_limit_test_() ->
[?_assertEqual(riichi:score(30, Yaku, true), Score) [?_assertEqual(riichi:score(30, Han, true), Score)
|| {Yaku, Score} <- || {Han, Score} <-
[ [
{ 5, 2000}, { 5, 2000},
{ 6, 3000}, { 6, 3000},