- html[html.length-1] = pieceChar[c][piece];\r
-\r
- s1.innerHTML = html.replace(/<bold>.*<\/bold>/i, "<bold>"+pieceChar[c][piece]+"</bold>"); \r
- }\r
- }\r
-\r
- /*\r
- if (ret.charAt(4) == "-" && ret.charAt(5) == ">") {\r
- //Piece has been moved\r
- //console.log("Moving other piece");\r
- lines = ret.split("\n");\r
- //if (lines[3] != "SELECT?") {\r
- if (lines[2] != "SELECT?") {\r
- x1 = lines[2].charAt(0);\r
- y1 = lines[2].charAt(2);\r
- x2 = lines[2].charAt(7);\r
- y2 = lines[2].charAt(9);\r
- console.log("Black Move: " + x1 + "" + y1 + " -> " + x2 + "" + y2);\r
- doMove(y1 + "" + x1, y2 + "" + x2);\r
- }\r
- else {\r
- console.log("Black Unable to move");\r
- }\r
- }\r
- else {\r
- lines = ret.split("\n");\r
- if (lines[1] == "MOVE?") {\r
- //We selected a piece\r
- //console.log("choose where to move our piece");\r
- piece = lines[0].charAt(6);\r
- //console.log("Piece: " + piece);\r
- content = document.getElementById(pieceSelected);\r
- contentHTML = content.innerHTML;\r
- //contentHTML = contentHTML.replace("?", piece);\r
- //"W<br /><small>p</small> <bold>?</bold> <small>?</small></span>";\r
- if (lines[0].charAt(4) == "1") {\r
- //console.log("changing quantum piece");\r
- contentHTML = replaceAt(contentHTML, 44, piece);\r