-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadditionMachine34.html
83 lines (62 loc) · 1.48 KB
/
additionMachine34.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
<html>
<head>
<script type="text/javascript">
var right = "right";
var left = "left";
var output = [];
output[0] = { state: "A", position:0, tape:[3,4] };
var stateTable = {
"A": {
1: [ 1, right, "B1" ],
2: [ 2, right, "B2" ],
3: [ 3, right, "B3" ],
4: [ 4, right, "B4" ]
},
"B1": {
1: [ 2, right, "Halt" ],
2: [ 3, right, "Halt" ],
3: [ 4, right, "Halt" ],
4: [ 5, right, "Halt" ]
},
"B2": {
1: [ 3, right, "Halt" ],
2: [ 4, right, "Halt" ],
3: [ 5, right, "Halt" ],
4: [ 6, right, "Halt" ]
},
"B3": {
1: [ 4, right, "Halt" ],
2: [ 5, right, "Halt" ],
3: [ 6, right, "Halt" ],
4: [ 7, right, "Halt" ]
},
"B4": {
1: [ 5, right, "Halt" ],
2: [ 6, right, "Halt" ],
3: [ 7, right, "Halt" ],
4: [ 8, right, "Halt" ]
},
};
</script>
<script type="text/javascript" src="js/jquery.min.js" /></script>
<script type="text/javascript" src="js/turingMachine.js" /></script>
<style type="text/css">
table {border:1px solid black;}
table td {border:1px solid black;};
</style>
</head>
<body>
<button type="button" id="step">step</button>
<button type="button" id="run">run</button>
<div id="stepNum">0</div>
<div id="currentState">Current State: A Read: - Write: -</div>
<div id="stateTable" style="float:left;">
</div>
<div id="outputTable" style="float:left;margin-left:50px">
<table>
<tr>
</tr>
</table>
</div>
</body>
</html>