Hello,
I am working on a small script that keeps track of a card game tournament/league I hold at my store. The card game is WWE Raw Deal (based upon the World Wrestling Federation, now World Wresting Entertainment).
First, the specifics...
I use MySQL database to keep records of each deck. Within each record is the following: ID, Deck Name, Player Name, Points Earned, Total Wins, Total Losses, Title Belt Variables (xx_belt, replace xx with a abreviation for a belt, hc_belt being the cardcore belt).
Current the script displays a list of the decks. It list them from top ranked player, ordered by wins DESC, loss ASC, points DESC (ties in wins are sorted by losses, and ties in wins&losses are sorted by points).
I also have mini scripts (I know I can make something better) that insert a small title belt icon with the abrivation of the belt as part of the icon.
Now, here is where I need some help. I want the script to figure out Number 1 Contendership to each title. Meaning, the person with the closest or best win/loss record is first in line to face a title holder.
Here are the requirements for being a Number 1 Contender...
1) Must be the most top ranked deck WITHOUT a title belt.
2) May not face another deck played by the same player.
I am having so many ideas on how I could work this out, but my script is already so sick looking that I am afraid I would make it worse.
here is a URL to the current result of my script.
http://www.macharbor.com/rawdeal/
The page is a temp to get the script working, and to at least have something to look at.
By todays rankings (Thursday, 12:20am) the number 1 contenders would be (note: since the page does not display player names, just deck names, I will fill in the player names with PlayerA, PlayerB, PlayerC, etc....
Chris Benoit could face either Chris Jericho for the Undisputed title OR could face Ric Flair for the Intercontinental title. HOWEVER, Flair and Benoit are played by PlayerB, so Benoit may only face Chris Jericho (played by PlayerA). Benoit is No1 Contender to the Jericho's title.
Raven is after Benoit and gets to face Ric Flair. Raven is played by the same person who plays Jericho, PlayerA.
This leads us to The Game, and in rank, he would go on to face Edge. However, The Game and Edge are yet again played by PlayerA (when there isn't enough players I usually allow up to 4 decks per player). Since The Game cannot face Edge, that falls upon Rob Van Dam (played by PlayerC).
Just something to get me rolling along.
Thank you.