Tournamex (tournamex v0.5.0)

Tournamex

Simple package for managing online tournament system. Tournamex only has a function for generating matchlist from list. We will add functions gradually.

Link to this section Summary

Functions

Returns data which is presenting tournament brackets.

Returns data which is presenting tournament brackets.

Check if the user has already lost.

Delete losers from match list.

Generates a matchlist.

Initialize match list of teams with fight result.

Put value on bracket list. The second argument 'key' should be the user id.

Renew match list with loser.

Link to this section Functions

Link to this function

brackets(match_list)

Specs

brackets([any()]) :: {:ok, [any()]} | {:error, String.t()}

Returns data which is presenting tournament brackets.

Link to this function

brackets_with_fight_result(match_list)

Specs

brackets_with_fight_result([any()]) :: {:ok, [any()]} | {:error, String.t()}

Returns data which is presenting tournament brackets.

Link to this function

check_lose?(match_list, user_id)

Specs

check_lose?([any()], integer()) :: boolean() | nil

Check if the user has already lost.

Link to this function

delete_loser(list, loser)

Specs

delete_loser([any()], [integer()] | integer()) :: [any()]

Delete losers from match list.

Link to this function

generate_matchlist(list)

Specs

generate_matchlist([integer()]) :: {:ok, [any()]} | {:error, String.t()}

Generates a matchlist.

Link to this function

initialize_match_list_of_team_with_fight_result(match_list, result \\ [])

Specs

initialize_match_list_of_team_with_fight_result([any()], [any()]) :: [any()]

Initialize match list of teams with fight result.

Link to this function

initialize_match_list_with_fight_result(match_list, result \\ [])

Specs

initialize_match_list_with_fight_result([any()], [any()]) :: [any()]

Initialize match list with fight result.

Link to this function

put_value_on_brackets(match_list, key, value, result \\ [])

Specs

put_value_on_brackets([any()], integer() | String.t() | atom(), any(), [any()]) ::
  [any()]

Put value on bracket list. The second argument 'key' should be the user id.

Link to this function

renew_match_list_with_loser(match_list, loser)

Specs

renew_match_list_with_loser([any()], integer()) :: [any()]

Renew match list with loser.

Link to this function

win_count_increment(match_list, user_id)

Specs

win_count_increment([any()], integer()) :: [any()]

Win count increment.