oldaccount's wall

View all
Highlighted comment

posting s code here because glitching

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>t+</title>
  <link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
 
  <script src="script.js"></script>
 
<style>
textarea {
  resize: none;
}
</style>
<textarea id="codes" name="codes" rows="4" cols="50">
test
</textarea>
<button type="codes" onclick="run();" id="codes">run</button>
<div id="notes">output here</div> 
<script>
function run() {
// setup
var action = "none"
action = "none"
var notclose = "true"
notclose = "true"
var command = "none"
command = "none"
var div = document.querySelector("#notes");
div.setAttribute('style', 'white-space: pre;');
div.textContent = "code \r\n";
//begin code
var code = codes.value  
let a = code.split("\n");
for (let i = 0; i < a.length; ++i) {
	let command = a[i];
  //evalcode
  if (command == ">") {
    alert(">")
    action = "none"
    command = "none"
  }
  if (action == "print") {
    div.textContent += command + "\r\n";
  }
  if (action == "none") {
    if (command == "<p") {
      action = "print";      
    }
  }
}
}
</script>
</body>
</html>