Hey all. I have what I think may be a fairly complex problem to solve, and I'm sure there are many solutions. I'd like your opinions. Here's the rundown. I'd like to create a "ladder" for a company table tennis league. This is how the ladder works:
[*]Players are, at first, randomly assigned a rank
[*]Players can challenge any player up to 5 ranks above them
[*]If the higher-ranked player wins, nothing changes
[*]If the lower-ranked player (the challenger) beats the higher-ranked player, the lower-ranked player takes the higher rank. The higher rank player drops down one rank
To clarify, an example:
[*]Molly (ranked 5) challenges James (ranked 3)
[*]Molly wins the match
[*]Molly is now ranked 3
[*]James is now ranked 4
How do I accomplish this? Should I store the ladder in its own table? Should I store players' ranks in their respective rows in the players table? Either way, I'll need to update every record in the table to reflect the new rankings. Is that a reasonable way of doing things? Is there a better way?
Thanks, guys.