pypair icon indicating copy to clipboard operation
pypair copied to clipboard

Unclear the purpose of the parameters

Open lazydroid opened this issue 2 years ago • 1 comments

In one of the samples there's the code:

            to.reportMatch(table, [2,0,0])
        elif per < 47:
            to.reportMatch(table, [2,1,0])
        elif per < 60:
            to.reportMatch(table, [0,2,0])
        elif per < 97:
            to.reportMatch(table, [1,2,0])
        elif per < 98:
            to.reportMatch(table, [0,0,1])
        else:
            to.reportMatch(table, [1,1,1])

Could you please explain, what these triplets mean? Assuming I'm playing chess, how winning with 2,0,0 is different from winning with 2,1,0 ? What is the third parameter for? Is 0,0,1 draw different from 1,1,1 draw?

Thanks!

lazydroid avatar Sep 26 '22 08:09 lazydroid

@lazydroid Looking through the code, it seems that this parameter is fairly useless. In the reportMatch function, it is only used when assigning otresult, which is directly added to the players "Results" key in the data, however, this data is actually never used. In the code, there are only 7 references to ["Results"]. 6 of them are in reportMatch when adding the data, and the 7th is in assignBye, where it just effectively reports a match with [0, 0, 0].

As further proof, the third item in any list is only ever used 4 times: list[2] is used twice in loadPlayersCSV to optionally set fixed player seating if it was defined in the CSV It used two more times to copy the 2nd value in Results for each player.

I'm rather confident and saying you can set this to 0 if you don't do anything with the data yourself.

DoubleF3lix avatar Dec 20 '22 20:12 DoubleF3lix