Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
puzz = ".00.00.\n0000000\n0000000\n.00000.\n..000..\n...0...";
|
||||
puzz //= StringSplit[#, "\n"] & /* Map[Characters];
|
||||
puzz //= Transpose /* Map[Reverse];
|
||||
pos = Position[puzz, "0", {2}];
|
||||
moves = Select[Select[Tuples[pos, 2], MatchQ[EuclideanDistance @@ #, 2 Sqrt[2] | 3] &], OrderedQ];
|
||||
g = Graph[UndirectedEdge @@@ moves];
|
||||
ord = Most[FindShortestTour[g][[2]]];
|
||||
Graphics[MapThread[Text, {Range[Length[ord]], VertexList[g][[ord]]}]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue