-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
105 lines (93 loc) · 4.46 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hodor Interpreter</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="app.js"></script>
<link rel="stylesheet" href="app.css">
<script type="text/javascript" src="hodor.js"></script>
</head>
<body>
<div class="container">
<div class="page-header">
<h2>Hodor Interpreter</h2>
<h4>Keep calm and Hodor Hodor</h4>
</div>
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<div class="alignLeft inLine">
Hodor Commands
</div>
<div class="alignRight inLine">
<button id="btnShowHide" type="button" class="btn btn-primary" data-toggle="collapse" data-target="#collapseOne" onclick="updateShowHideText();">Hide</span></button>
</div>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel panel-default">
<table class="table table-hover table-condensed tableFontSize">
<thead>
<th>Command</th><th>Meaning</th>
</thead>
<tbody>
<tr><td>Hodor. Hodor?</td><td>Increment the data pointer (to point to the next cell to the right).</td></tr>
<tr><td>Hodor? Hodor.</td><td>Decrement the data pointer (to point to the next cell to the left).</td></tr>
<tr><td>Hodor. Hodor.</td><td>Increment (increase by one) the byte at the data pointer.</td></tr>
<tr><td>Hodor! Hodor!</td><td>Decrement (decrease by one) the byte at the data pointer.</td></tr>
<tr><td>Hodor! Hodor.</td><td>Output the byte at the data pointer.</td></tr>
<tr><td>Hodor. Hodor!</td><td>Accept one byte of input, storing its value in the byte at the data pointer.</td></tr>
<tr><td>Hodor! Hodor?</td><td>If the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching Hodor? Hodor! command.</td></tr>
<tr><td>Hodor? Hodor!</td><td>If the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching Hodor! Hodor? command.</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<div class="alignLeft inLine">
Hodor Source Code
</div>
<div class="alignRight inLine">
<div class="btn-group">
<button type="button" class="btn btn-primary" name="helloworld" id="helloworld" onclick="insertHelloWorld();">insert <b>Hello World Example</b></button>
<a class="btn btn-default" href="http://en.wikipedia.org/wiki/Hello_world_program">view <b>Wiki</b></a>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary" name="rot13" id="rot13" onclick="insertRot13();">insert <b>Rot13 Example</b></button>
<a class="btn btn-default" href="http://en.wikipedia.org/wiki/ROT13">view <b>Wiki</b></a>
</div>
</div>
<h4 class="panel-title">
</div>
<div class="alert alert-danger" id="errorAlert" style="display:none"></div>
<textarea class="form-control" style="resize:none" name="source" rows="7" id="source" onkeydown="enableInputBox();" oninput="enableInputBox();" placeholder="Hodor Source Code"></textarea>
</div>
<div class="panel panel-default" id="inputDiv" style="display:none">
<div class="panel-heading">Hodor Input</div>
<textarea class="form-control" style="resize:none; display:none" name="input" rows="2" id="input" placeholder="Hodor Input"></textarea>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<div class="alignLeft inLine">
Hodor Output
</div>
</h4>
</div>
<textarea class="form-control" style="resize:none" name="output" rows="2" id="output" placeholder="Hodor Output"></textarea>
</div>
<div class="input-group pull-right">
<button type="button" class="btn btn-primary" name="hodor" id="hodor" onclick="interpret('source','output');">execute <b>Hodor!</b></button>
</div>
</div>
<link rel="stylesheet" href="static/analytics.js" type="text/javascript">
</body>
</html>