From d08c4691ac5d104e6a2a0adef4ba71a90b61de97 Mon Sep 17 00:00:00 2001 From: TheShinyMelon Date: Tue, 6 Dec 2022 12:42:16 +0100 Subject: [PATCH] progress is at like 25%; parsing is hard --- 5/script.js | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5/tuer5.html | 29 ++------------- 2 files changed, 103 insertions(+), 26 deletions(-) create mode 100644 5/script.js diff --git a/5/script.js b/5/script.js new file mode 100644 index 0000000..011c85f --- /dev/null +++ b/5/script.js @@ -0,0 +1,100 @@ +let output = document.getElementById("output"); +let input; +let linesArr; +let parsedArr = []; +let cmdArr = []; + +function readFile(input) { + let file = input.files[0]; + let fileReader = new FileReader(); + fileReader.readAsText(file); + fileReader.onload = function() { + input = fileReader.result; + linesArr = input.split("\n"); + }; + fileReader.onerror = function() { + alert(fileReader.error); + }; +} + +let start = document.getElementById("start"); +start.addEventListener("mouseover", () => { + start.innerHTML = "pwease pwess mee hawwd mastaaa! ~^o^~" +}); +start.addEventListener("mouseout", () => { + start.innerHTML = "sowwy mastaa! Ow0;" +}); +start.addEventListener("click", () => { + parseArr(); //continue with parsedArr + parseCmd(); +}); + +function parseArr() { //parsing is hard + let stackArr = []; + let cleanArr = []; + + for(let l=0; l<9; l++) { + let tmpLine = []; + for(let i=0; i -

Input-File:

+

Input-File:


Output:

-

OwO Mastaaw, I dow't like bewwing in a webbwosaaww!! I feew dizzy.. -o- Anyway hewe's youww numbaaw UmU~ :

+

OwO Mastaaw, I dow't like bewwing in a webbwosaaww!! I feew dizzy.. OwO° Anyway hewe's youww numbaaw UmU~ :

- \ No newline at end of file + \ No newline at end of file