-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
221 lines (204 loc) · 8.52 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html>
<head>
<title>Turing machine</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="turingmachine.css" />
<meta name="viewport" content="width=800, initial-scale=1.0" />
<meta name="application-name" content="turingmachine.js – turingmachine online simulator" />
<meta name="keywords" content="Turingmachine, computation, Alan Turing, simulator, play, run, html5, css3, javascript, js" />
<script type="text/javascript" src="deps/jquery-1.11.3.js"></script>
<script type="text/javascript" src="deps/jjv-1.0.2.js"></script>
<script type="text/javascript" src="turingmachine.js"></script>
<script type="text/javascript">
$(document).ready(function () {
app = main();
});
</script>
</head>
<body>
<div id="overlay">
</div>
<div id="overlay_text">
<h4>JSON <span class="action">Export</span></h4>
<p>
Format: <select class="export_format">
<option value="json">JSON</option>
<option value="foswiki">Foswiki</option>
</select>
</p>
<p><textarea class="data" cols="50" rows="10" readonly></textarea></p>
<p><input type="submit" class="import" value="Import" /></p>
</div>
<section id="notes">
<h3>Notes</h3>
</section>
<header id="title">
<h1>Turingmachine</h1>
<p>
<span id="caption">Turing machine for educational purposes</span> <br />
2013–2015, <abbr title="Free/libre open source software">FLOSS</abbr> software,
version 1.0.2
</p>
</header>
<section class="turingmachine">
<h2 style="display:none">Turingmachine animation</h2>
<div class="gear-animation" id="gear">
<img src="static/gear.svg" alt="Gear animation" width="150" height="150" />
</div>
<div class="io">
<a class="import_button">Import</a> |
<a class="export_button">Export</a>
</div>
<label class="no_animation">
disable animation
<input type="checkbox" name="wo_animation" />
</label>
<div class="drawings">
<div class="tape">
<img class="cursor" src="static/machine.png" alt="Machine" />
<div class="writer"></div>
</div>
<div class="state final undefined">Start</div>
<div class="numbers"></div>
</div>
<div class="controls">
<p>
<input type="text" class="steps_prev" size="4" value="1" /> steps
<input type="submit" class="control_prev button" value="back" />
<span class="space">|</span>
<input type="submit" class="control_next button" value="continue" />
<input type="text" class="steps_next" size="4" value="1" /> steps
<br />
<input type="submit" class="control_slower button" value="Slower" />
<input type="submit" class="control_reset button" value="Reset" />
<input type="submit" class="control_run button" value="Run" />
<input type="submit" class="control_faster button" value="Faster" />
<span class="interrupt">
<br />
<input type="submit" class="control_interrupt button" value="Abort run" />
</span>
</p>
</div>
</section>
<section class="turingmachine_meta">
<div class="description">
<noscript>
This web application will not work without Javascript! Sorry!
</noscript>
<h3 class="description_title">Help</h3>
<div class="description_text">
<p>Hi!</p>
<p>
This project is all about <em>turingmachines</em>. What are turingmachines?
They are a computational concept from <em>Theoretical Computer Science</em> (TCS)
by Alan Turing (* 1912 † 1954). They illustrate one possible way to define computation
and are as powerful as your computer. So how do they work?
</p>
<p>
Above you can see the animated turing machine with several control elements underneath.
The animation consists of a tape (with bright background color) and one cursor
(winded green structure). The text at the left bottom of the animation is called
<em>current state</em>.
You can press "continue" to compute the next <em>step</em>. What are steps?
</p>
<p>
At the bottom you can see a <em>transition table</em>. It defines a current situation,
consisting of a read symbol and a state, and the next situation after one step has been
performed. So when you press "continue" the program will read the symbol focused by the
cursor and the current state. It will search for a line in the transition table matching
those 2 values and will execute the corresponding result. The result consists of a symbol
to write, a movement of the tape and a successor tape.
</p>
<p>
You can edit the transition table yourself. Try it! 😊
</p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Turingmachine">Wikipedia: Turingmachine</a></li>
<li><a href="https://en.wikipedia.org/wiki/Alan_Turing">Wikipedia: Alan Turing</a></li>
</ul>
</div>
<div class="description_version">
<p><strong>Program version:</strong> <span>1.2 / 23rd of Aug 2015 / meisterluk</span></p>
</div>
</div>
<p>
Load example program:
<select class="example">
<option data-none="true">no example programs available</option>
</select>
<input type="submit" class="example_load" value="Load to visualization" /><br />
Run testcase:
<select class="testcase">
<option value="null">no testcase available</option>
</select>
<input type="submit" class="testcase_load" value="Load to visualization" />
<input type="submit" class="testcase_runall" value="Run All" />
</p>
<h3>Runtime properties</h3>
<table>
<thead>
<tr>
<td style="text-align:right">Set machine name:</td>
<td style="text-align:left"><input type="text" class="machine_name" size="20" maxlength="255" /></td>
</tr>
</table>
</section>
<section class="turingmachine_data">
<h2>Data</h2>
<p>
<input type="submit" class="tape_load" value="Load tape" /> <br/>
<input type="text" size="40" value="" class="tape" title="denote the cursor with surrounding *asterisks*" style="text-align:center" />
</p>
<p>
<input type="submit" class="final_states_load" value="Set final states" /> <br />
<input type="text" size="40" value="" class="final_states" style="text-align:center" />
</p>
<h2>Transition table</h2>
<div>
<table class="transition_table">
<thead>
<tr>
<td>If symbol read</td>
<td>in state</td>
<td class="then">write</td>
<td>move to</td>
<td>go into state</td>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" class="tt_read" value="0" autocomplete="off" size="5" /></td>
<td><input type="text" class="tt_from" value="Start" size="10" /></td>
<td class="then"><input type="text" class="tt_write" autocomplete="off" value="0" size="5" /></td>
<td>
<select class="tt_move">
<option>Stop</option>
<option>Left</option>
<option>Right</option>
</select>
</td>
<td><input type="text" class="tt_to" value="nextState" size="10" /></td>
</tr>
<tr>
<td><input type="text" class="tt_read" autocomplete="off" size="5" /></td>
<td><input type="text" class="tt_from" size="10" /></td>
<td class="then"><input type="text" class="tt_write" autocomplete="off" value="" size="5" /></td>
<td>
<select class="tt_move">
<option>Stop</option>
<option>Left</option>
<option>Right</option>
</select>
</td>
<td><input type="text" class="tt_to" value="" size="10" /></td>
</tr>
</tbody>
</table>
<p>
<input type="submit" class="copy_last_line" value="Copy second to last line" />
</p>
</div>
</section>
</body>
</html>