creating html table based on an algorithm suggestion
I'm trying to create an algorithm and want to get your suggestions about that.
There are 4 numbers from 1 to 4 (The sum of this number can vary e.q: 10 or 20). According to the above total number a html table will occur automatically as below.
After the formation of the table;
- Every number will put into the table randomly from R1 to R3 just once.
- Every number necessarily must be in every rows. 开发者_如何学JAVA
- If current number was in B side (of colums), next time (i mean, in next row) must be in A side or just the opposite.
- Every numbers necessarily must match just once in whole table.
Thank you very much for your advice, help and suggust already now.
Is this the algorithm to match teams together in tournaments and make sure each team plays against every other team just once? If so, you may want to look into the Swiss-system tournament or Round-Robin tournament. It may be very hard to do this in a randomized fashion, it might work better to use a systematic approach.
精彩评论