-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
44 lines (38 loc) · 1.58 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Live IDE</title>
<link rel="stylesheet" href="lib/codemirror.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="jsparser.js" type="text/javascript"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="lib/codemirror.js" type="text/javascript"></script>
<script src="lib/javascript.js" type="text/javascript"></script>
<script src="script.js" type="text/javascript"></script>
</head>
<body>
<div id="header"><a href="https://github.com/lhchavez/liveide">LiveIDE</a></div>
<textarea id="source">// Welcome to LiveIDE.
// Type a JavaScript program and the varibles will update in real time.
var items = [1, 2, 4, 6, 8, 10, 11, 13, 15, 17, 21];
var value = 1;
var startIndex = 0,
stopIndex = items.length - 1,
middle = Math.floor((stopIndex + startIndex)/2);
while (items[middle] != value && startIndex < stopIndex) {
//adjust search area
if (value < items[middle]){
stopIndex = middle - 1;
} else if (value > items[middle]){
startIndex = middle + 1;
}
//recalculate middle
middle = Math.floor((stopIndex + startIndex)/2);
}
// make sure it's the right value
var result = (items[middle] != value) ? -1 : middle;</textarea><table id="code"><tbody></tbody></table>
<br class="clear" />
<textarea id="debug"></textarea>
<textarea id="debug2"></textarea>
</body>
</html>