[Community Puzzle] Dots and Boxes

https://www.codingame.com/multiplayer/bot-programming/dots-and-boxes

Send your feedback or ask for help here!

Created by @EricSMSO,validated by @Zenoscave,@trictrac and @field3.
If you have any issues, feel free to ping them.

@EricSMSO, it seems like the referee is returning score 1.0 for the winner and -1.0 for the loser. It would be better if it instead returned the real score (e.g. 25.0 vs 24.0) and used -1.0 only in case of timeout.

I thought setScore() was a true/false method. Do you mean It would be used in the leaderboard to make a difference between winning with a great score difference or winning with close scores?

Unless we speak about a different method, Player.setScore takes an int parameter, not a boolean. The integer parameter is used to rank the players, which is what will be used by the leaderboard. So using the real score (and -1.0 for timeouts) will not change the leaderboard. However, it is better practice: it makes it easier for community tools that parse replays to detect timeouts, and to learn information about the final score, which is otherwise hidden.

2 Likes

Ah ok, I will see if I can change this this weekend. I think I copied this behaviour from the Tic Tac Toe referee. Where did you get the information about the setScore() method from?

Done. Hope I haven’t broken anything.

1 Like