-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathide.html
69 lines (69 loc) · 1.89 KB
/
ide.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<title>EasyIO IDE</title>
<script src="compiler.js"></script>
<body>
<center>
Progress: <progress value="0" max="100" id="progress"></progress>
<input type="submit" value="Run" onclick="run()" align="right" />
<br>
<textarea cols="60" rows="25" id="editor"></textarea>
<textarea readonly cols="60" rows="25" id="console"></textarea>
</center>
<br>
<h2>Documentation:</h2>
<h3>Types:</h3>
<h4>string</h4>
<p>A string is a combination of characters surrounded by quotes. EX: "hello"</p>
<h4>integer</h4>
<p>An integer is a whole number. Numbers with decimals are always rounded down. EX: 3</p>
<h4>number</h4>
<p>A number is a rational number. If it is irrational it will be rounded to 16 decimal places. EX: 1.3</p>
<h3>Operators:</h3>
<h4>+</h4>
<p>Adds two variables. You can only add strings and numbers. EX: 2+2</p>
<h4>-</h4>
<p>Subtracts two numbers. EX: 5-4</p>
<h4>*</h4>
<p>Multiplies two numbers. EX: 4*5</p>
<h4>/</h4>
<p>Divides two numbers. EX: 20/4</p>
<h3>Commands:</h3>
<h4>print</h4>
<p>Prints the following variable. You can only print strings and numbers. EX: print "hello"</p>
</body>
<script>
var progressbar = document.getElementById("progress");
var iconsole = document.getElementById("console");
var editor = document.getElementById("editor");
var newl = "\n"
var line = 1;
function run() {
progressbar.value = 0;
code = editor.value;
compile(code);
if (errorlist.length === 0) {
eval(compiledcode);
}
}
function consolePrint(data) {
if (line === 1) {
data = "> " + data;
iconsole.value += data;
line += 1;
}
else {
data = "\n> " + data;
iconsole.value += data;
}
}
function consoleClear() {
iconsole.value = "";
line = 1;
iconsole.style.color = "black";
}
editor.value = "print \"hello world\"";
run();
</script>
</html>