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