diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-26 16:22:52 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-26 16:22:52 +0100 |
commit | b5a9b4cb4863e2af220ff50f51b68c0035caa927 (patch) | |
tree | 701f1c2d3b7857ac00828e45fd6d4c1c1a981ad3 /FICS | |
parent | 08c22ff5c443c78fc0be9a3fea7df94edb54dda8 (diff) |
Reformatted GameMatchesFormula()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/formula.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/FICS/formula.c b/FICS/formula.c index 77cf89f..447caba 100644 --- a/FICS/formula.c +++ b/FICS/formula.c @@ -514,27 +514,34 @@ void ExplainFormula (game *g, textlist *eval) } #endif -/* GameMatchesFormula converts parameters to a game structure - and passes a pointer to this game to CheckFormula for - evaluation. It returns the evaluated formula. -*/ -PUBLIC int GameMatchesFormula (int w, int b, int wTime, int wInc, int bTime, - int bInc, int rated, int gametype, textlist **clauseList) +/* + * GameMatchesFormula() converts parameters to a game structure and + * passes a pointer to this game to CheckFormula() for evaluation. It + * returns the evaluated formula. + */ +PUBLIC int +GameMatchesFormula(int w, int b, int wTime, int wInc, int bTime, int bInc, + int rated, int gametype, textlist **clauseList) { - game g; - int index=0, ret; - - g.white = w; g.black = b; - g.wInitTime = wTime; g.bInitTime = bTime; - g.wIncrement = wInc; g.bIncrement = bInc; - g.rated = rated; - g.type = gametype; - - if (CheckFormula(&g, MAX_FORMULA, &index, OPTYPE_NONE, &ret, 1) != ERR_NONE) - return (0); - if (ret == 0) ExplainFormula (&g, clauseList); - return (ret); -} /* end of function GameMatchesFormula. */ + game g; + int index = 0, ret; + + g.white = w; + g.black = b; + g.wInitTime = wTime; + g.bInitTime = bTime; + g.wIncrement = wInc; + g.bIncrement = bInc; + g.rated = rated; + g.type = gametype; + + if (CheckFormula(&g, MAX_FORMULA, &index, OPTYPE_NONE, &ret, 1) != + ERR_NONE) + return 0; + if (ret == 0) + ExplainFormula (&g, clauseList); + return ret; +} /* * SetValidFormula() sets a clause of player 'p' and creates a game |