Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/witchess_solver.ash
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ string ws_dirsToCoords(string dirs) {

int move = 0;

int[string] path;
int[string] witchess_path;

ws_matcher_rludConvert.reset(dirs);
while (ws_matcher_rludConvert.find()) {
Expand Down Expand Up @@ -229,18 +229,18 @@ string ws_dirsToCoords(string dirs) {
ws_throwErr("Error occurs at move " + move);
return "";
}
path[writeX + "," + writeY] = 0;
witchess_path[writeX + "," + writeY] = 0;
}

if (x != 0 || y != ws_puzzleDimX * 2) {
ws_throwErr("Solution does not correctly terminate! x:" + x + " y:" + y);
ws_throwErr("dimX: " + ws_puzzleDimX + " dimY:" + ws_puzzleDimY);
}

sort path by index;
sort witchess_path by index;

string result = "";
foreach coord, val in path {
foreach coord, val in witchess_path {
result += "|" + coord;
}

Expand Down