开发者

creating html table based on an algorithm suggestion

开发者 https://www.devze.com 2023-03-20 02:17 出处:网络
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).

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.

creating html table based on an algorithm suggestion

After the formation of the table;

  1. Every number will put into the table randomly from R1 to R3 just once.
  2. Every number necessarily must be in every rows.
  3. 开发者_如何学JAVA
  4. 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.
  5. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消