An algorithm for finding code

There is an array of up to 30 elements in a type of element, the number of random, hope to get a specific arrangement, as shown in Fig.:

If the number of elements of a less than 30 in number, a small place priority fill, number of blank.
Thank you

Started by Jim at December 07, 2016 - 9:21 AM

An algorithm is given for your own: according to this scheme into source code

1 data will be converted to ABCDEFGHABCDEGHABCDEGHABCABCAC format
2.1 in order to read data into the corresponding number in the grid.
2.1 the content of lattice grid and neighboring compared. If not identical, to read the next data. If the same into the 3.1
3.1 the lattice with a lattice content exchange. On two data exchange after repeated 2.1 comparison. If it has been replaced by the first data have the same, no solution.

The following is the previous step

Posted by Debbie at December 17, 2016 - 9:30 AM