absolutely proprietary
This commit is contained in:
parent
d08c4691ac
commit
b205529a11
14
5/script.js
14
5/script.js
@ -70,6 +70,7 @@ function parseArr() { //parsing is hard
|
|||||||
}
|
}
|
||||||
parsedArr[i] = tmpLine;
|
parsedArr[i] = tmpLine;
|
||||||
}
|
}
|
||||||
|
console.log("parsedArr", parsedArr);
|
||||||
}
|
}
|
||||||
|
|
||||||
function move(a, s, d) {
|
function move(a, s, d) {
|
||||||
@ -91,10 +92,17 @@ function getTopPos(s) {
|
|||||||
|
|
||||||
function parseCmd() {
|
function parseCmd() {
|
||||||
for(let i=10; i<linesArr.length; i++) {
|
for(let i=10; i<linesArr.length; i++) {
|
||||||
|
let tmpLine = [];
|
||||||
for(let j=0; j<linesArr[i].length; j++) {
|
for(let j=0; j<linesArr[i].length; j++) {
|
||||||
if(linesArr[i].charAt(j)=='m') cmdArr[i-10] = linesArr[i].substr(j+2,1);
|
if(linesArr[i].charAt(j)=='m') {
|
||||||
if(linesArr[i].charAt(j)=='f') cmdArr[i-10] = linesArr[i].substr(j+2,1);
|
let tmp = 1;
|
||||||
if(linesArr[i].charAt(j)=='t') cmdArr[i-10] = linesArr[i].substr(j+2,1);
|
if(linesArr[i][j+1]!=' ') tmp = 2
|
||||||
|
tmpLine[tmpLine.length] = linesArr[i].substr(j+5,tmp);
|
||||||
|
}
|
||||||
|
if(linesArr[i].charAt(j)=='f') tmpLine[tmpLine.length] = linesArr[i].substr(j+5,1);
|
||||||
|
if(linesArr[i].charAt(j)=='t') tmpLine[tmpLine.length] = linesArr[i].substr(j+3,1);
|
||||||
}
|
}
|
||||||
|
cmdArr[i-10] = tmpLine;
|
||||||
}
|
}
|
||||||
|
console.log("cmdArr", cmdArr);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user