Home > Back-end >  Jigsaw puzzle game, a picture should be upset with what kind of algorithm, to ensure that there is t
Jigsaw puzzle game, a picture should be upset with what kind of algorithm, to ensure that there is t

Time:09-22

Ask everybody to help, give point data,

CodePudding user response:

Initialize the correct data, and then n random according to the normal rules of mobile (not rendering interface, performance is soon)

CodePudding user response:

As long as each piece only once is ok,

CodePudding user response:

reference 1st floor zswang response:
initialize the correct data, and then n random according to the normal rules of mobile (not rendering interface, performance is soon)

I also thought, but the more simple, can be arbitrary swap places

CodePudding user response:

Reverse order number, put the jigsaw puzzle as a permutation, upset after calculating the parity of the number of reverse order went, parity has same solution (if in the original order, the original number of reverse order is 0, disturb after the even number of reverse order), because of the high probability of 1/2, and detect the should go up faster than according to the rules

CodePudding user response:

reference 4 floor cfvmario response:
reverse order number, the puzzles as a permutation, upset after calculating the parity of the number of reverse order went, parity has same solution (if in the original order, the original number of reverse order is 0, disturb after the even number of reverse order), because of the high probability of 1/2, testing this should be faster than according to the rules to disturb


Reverse order number, 4/f, how to seek such as array is n by n I ask

CodePudding user response:

N by n array, circulation again, with 1/2 probability random exchange of two elements,

CodePudding user response:

I feel not random,

Title has the problem solving method, there must be way,
Arranged in accordance with the law, can use this law of problem solving
  • Related