Frankie T Posted January 17, 2011 Share Posted January 17, 2011 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. Link to comment https://forums.phpfreaks.com/topic/224685-table-tennis-ladder/ Share on other sites More sharing options...
thehippy Posted January 17, 2011 Share Posted January 17, 2011 I had this bookmarked, its not a pure (Player, Rank) example but a (Player, Points, Rank) example, which may work for you. Link to comment https://forums.phpfreaks.com/topic/224685-table-tennis-ladder/#findComment-1160597 Share on other sites More sharing options...
Frankie T Posted January 17, 2011 Author Share Posted January 17, 2011 Thanks. It seems like, then, that it's just a matter of updating every single row. There's no easy way around it. Anyone else have an opinion? Link to comment https://forums.phpfreaks.com/topic/224685-table-tennis-ladder/#findComment-1160853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.