it's not workinggg
This commit is contained in:
parent
eed32a6b52
commit
96f7cc5a57
19
5/script.js
19
5/script.js
@ -1,4 +1,5 @@
|
||||
let output = document.getElementById("output");
|
||||
let errorOutput = document.getElementById("error");
|
||||
let input;
|
||||
let linesArr;
|
||||
let parsedArr = [];
|
||||
@ -25,7 +26,17 @@ start.addEventListener("mouseout", () => {
|
||||
start.innerHTML = "sowwy mastaa! Ow0;"
|
||||
});
|
||||
start.addEventListener("click", () => {
|
||||
parseArr();
|
||||
try {
|
||||
parseArr();
|
||||
}
|
||||
catch(e) {
|
||||
console.error(e);
|
||||
errorOutput.innerHTML = "^^^ pwease gibe me file fiwwst!!1! :3";
|
||||
return 1;
|
||||
}
|
||||
if (errorOutput.innerHTML != "") {
|
||||
errorOutput.innerHTML = "senk ju~ *UwU~";
|
||||
}
|
||||
parseCmd();
|
||||
for(let i=0; i<cmdArr.length; i++) {
|
||||
move(cmdArr[i][0], cmdArr[i][1], cmdArr[i][2]);
|
||||
@ -36,6 +47,7 @@ start.addEventListener("click", () => {
|
||||
}
|
||||
console.log("parsedArr after move()", parsedArr);
|
||||
console.log("ANSWER UwU", answer);
|
||||
output.innerHTML += " " + answer + " ╭∩╮UwU╭∩╮";
|
||||
});
|
||||
|
||||
function parseArr() { //parsing is hard
|
||||
@ -68,12 +80,13 @@ function parseArr() { //parsing is hard
|
||||
}
|
||||
console.log("cleanArr", cleanArr);
|
||||
|
||||
for(let i=0; i<cleanArr.length-1; i++) {
|
||||
for(let i=0; i<cleanArr.length; i++) {
|
||||
tmpLine = [];
|
||||
let c=7;
|
||||
for(let j=0; j<8; j++) {
|
||||
if(cleanArr[j][i] != undefined) {
|
||||
if(cleanArr[j][i] != undefined/* || cleanArr[j][i] != null || typeof(cleanArr[j][i]) != "NaN"*/) {
|
||||
tmpLine[c] = cleanArr[j][i];
|
||||
console.log(tmpLine, cleanArr[j][i]);
|
||||
}
|
||||
c--;
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<body>
|
||||
<h3>Input-File: </h3><input onchange='readFile(this)' type='file'>
|
||||
<body style="background-color: #3333; font-family: monospace;">
|
||||
<h3>Input-File: </h3>
|
||||
<input onchange='readFile(this)' type='file'>
|
||||
<button id="start">pwess mee! UwU~</button>
|
||||
<p id='error'></p>
|
||||
<hr>
|
||||
<h3>Output:</h3>
|
||||
<p id=output>OwO Mastaaw, I dow't like bewwing in a webbwosaaww!! <br><br>I feew dizzy.. OwO° Anyway hewe's youww numbaaw UmU~ :</p>
|
||||
<p id=output>OwO Mastaaw, I dow't like bewwing in a webbwosaaww!! <br><br>I feew dizzy.. OwO° Anyway hewe's youww ansaaww UmU~ :</p>
|
||||
</body>
|
||||
|
||||
<script src='script.js'></script>
|
Loading…
Reference in New Issue
Block a user