Don’t repeat yourself, right?
Maybe it’s early but I’m having a tough time wrapping my mind around all the permutations I want to do with player data.
The following represents payload variables for API requests.
rated_wins_as_white_19 = {
'ordering':'-id',
'width':'19',
'height':'19',
'white':'1403',
'ranked':'true',
'annuled':'false',
'white_loses':'false',
'black_loses':'true',
}
rated_losses_as_white_19 = {
'ordering':'-id',
'width':'19',
'height':'19',
'white':'1403',
'ranked':'true',
'annuled':'false',
'white_loses':'true',
'black_loses':'false',
}
rated_wins_as_black_19 = {
'ordering':'-id',
'width':'19',
'height':'19',
'black':'1403',
'ranked':'true',
'annuled':'false',
'white_loses':'true',
'black_loses':'false',
}
rated_wins_as_black_19 = {
'ordering':'-id',
'width':'19',
'height':'19',
'black':'1403',
'ranked':'true',
'annuled':'false',
'white_loses':'false',
'black_loses':'true',
}
I can brute force my way through it. It is an issue of copy, paste, and adjust but I code so I don’t have to do that.
Right now, I will probably make all the payload permutations in a dictionary and iterate through them unless somebody here has a better idea.