diff --git a/5/script.js b/5/script.js index 1b309be..875f1fd 100644 --- a/5/script.js +++ b/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 { } console.log("parsedArr after move()", parsedArr); console.log("ANSWER UwU", answer); + output.innerHTML += " " + answer + "     ╭∩╮UwU╭∩╮"; }); function parseArr() { //parsing is hard @@ -56,7 +68,7 @@ function parseArr() { //parsing is hard console.log("stackArr", stackArr); for(let i=0; i - -

Input-File:

+ +

Input-File:

+ +


Output:

-

OwO Mastaaw, I dow't like bewwing in a webbwosaaww!!

I feew dizzy.. OwO° Anyway hewe's youww numbaaw UmU~ :

+

OwO Mastaaw, I dow't like bewwing in a webbwosaaww!!

I feew dizzy.. OwO° Anyway hewe's youww ansaaww UmU~ :

\ No newline at end of file