diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-10 17:31:12 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-10 17:31:12 +0100 |
commit | 9b516c5054d414b38912201d8a2348f317e16160 (patch) | |
tree | 365e581c6d67db09b1d89fe26f3a68521d50967d /FICS | |
parent | 4afc4cc0f15994ed051da2d1626b72ccbabee903 (diff) |
Reformatted the file
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/rating_conv.c | 72 |
1 files changed, 40 insertions, 32 deletions
diff --git a/FICS/rating_conv.c b/FICS/rating_conv.c index 44a7d95..977f978 100644 --- a/FICS/rating_conv.c +++ b/FICS/rating_conv.c @@ -8,67 +8,75 @@ #include "rating_conv.h" #include "utils.h" -PRIVATE int elo_to_uscf(int elo) +PRIVATE int +elo_to_uscf(int elo) { - return elo + 100; + return (elo + 100); } -PRIVATE int uscf_to_elo(int uscf) +PRIVATE int +uscf_to_elo(int uscf) { - return uscf - 100; + return (uscf - 100); } -PRIVATE int bcf_to_elo(int bcf) +PRIVATE int +bcf_to_elo(int bcf) { - return bcf * 8 + 600; + return (bcf * 8 + 600); } -PRIVATE int elo_to_bcf(int elo) +PRIVATE int +elo_to_bcf(int elo) { - return (elo - 600) / 8; + return (elo - 600) / 8; } -PRIVATE int uscf_to_bcf(int uscf) +PRIVATE int +uscf_to_bcf(int uscf) { - return (uscf - 700) / 8; + return (uscf - 700) / 8; } -PRIVATE int bcf_to_uscf(int bcf) +PRIVATE int +bcf_to_uscf(int bcf) { - return bcf * 8 + 700; + return (bcf * 8 + 700); } -PRIVATE void printgrades(int p, int elo, int uscf, int bcf) +PRIVATE void +printgrades(int p, int elo, int uscf, int bcf) { - pprintf(p, "Grading conversion:\n"); - pprintf(p, " ELO = %d, USCF = %d, BCF = %d\n", elo, uscf, bcf); + pprintf(p, "Grading conversion:\n"); + pprintf(p, " ELO = %d, USCF = %d, BCF = %d\n", elo, uscf, bcf); } -PUBLIC int com_CONVERT_BCF(int p, param_list param) +PUBLIC int +com_CONVERT_BCF(int p, param_list param) { - int elo = bcf_to_elo(param[0].val.integer); - int uscf = elo_to_uscf(elo); + int elo = bcf_to_elo(param[0].val.integer); + int uscf = elo_to_uscf(elo); - printgrades(p, elo, uscf, param[0].val.integer); - return COM_OK; + printgrades(p, elo, uscf, param[0].val.integer); + return COM_OK; } -PUBLIC int com_CONVERT_ELO(int p, param_list param) +PUBLIC int +com_CONVERT_ELO(int p, param_list param) { - int bcf = elo_to_bcf(param[0].val.integer); - int uscf = elo_to_uscf(param[0].val.integer); + int bcf = elo_to_bcf(param[0].val.integer); + int uscf = elo_to_uscf(param[0].val.integer); - printgrades(p, param[0].val.integer, uscf, bcf); - return COM_OK; + printgrades(p, param[0].val.integer, uscf, bcf); + return COM_OK; } - -PUBLIC int com_CONVERT_USCF(int p, param_list param) +PUBLIC int +com_CONVERT_USCF(int p, param_list param) { - int elo = uscf_to_elo(param[0].val.integer); - int bcf = elo_to_bcf(elo); + int elo = uscf_to_elo(param[0].val.integer); + int bcf = elo_to_bcf(elo); - printgrades(p, elo, param[0].val.integer, bcf); - return COM_OK; + printgrades(p, elo, param[0].val.integer, bcf); + return COM_OK; } - |