-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
199 lines (180 loc) · 7.37 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
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>汉诺塔小游戏</title>
<meta name="keywords" content="汉诺塔,河内塔,汉诺塔在线玩,汉诺塔攻略" />
<meta name="description"
content="汉诺塔(又称河内塔)问题是源于印度一个古老传说的益智玩具。大梵天创造世界的时候做了三根金刚石柱子,在一根柱子上从下往上按照大小顺序摞着64片黄金圆盘。大梵天命令婆罗门把圆盘从下面开始按大小顺序重新摆放在另一根柱子上。并且规定,在小圆盘上不能放大圆盘,在三根柱子之间一次只能移动一个圆盘。" />
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/default.css">
<link rel="stylesheet" href="css/sweet-alert.css">
<style type="text/css">
table {
font: bold 13px Verdana
}
p {
font: normal 11px Tahoma, Verdana
}
input,
select {
font: normal 12px Tahoma, Verdana
}
select {
width: 40px
}
a {
font-weight: bold
}
.tower {
position: absolute;
visibility: visible;
left: 77px;
top: 184px;
font: bold 10px Tahoma
}
.container {
position: absolute;
visibility: visible;
}
.towervert {
position: absolute;
visibility: visible;
border: 1px solid black;
background-color: black
}
.towerhoriz {
position: absolute;
visibility: visible;
border: 1px solid black;
font-size: 1px;
background-color: black;
}
.disk {
position: absolute;
visibility: visible;
border: 1px solid black;
}
.bottom {
position: relative;
border: 1px solid black;
}
.heneita-footer {
position: absolute;
visibility: visible;
bottom: 0;
margin: 0 auto;
text-align: center;
}
</style>
<script type="text/javascript" src="js/sweet-alert.min.js"></script>
<script type="text/javascript" src="js/hanoi.js"></script>
</head>
<body onload="init();">
<!--<body onload="init();" onselectstart="return false" oncontextmenu="return false">-->
<div class="heneita-container">
<header class="heneita-header">
<h1>汉诺塔小游戏<span>Tower of Hanoi</span></h1>
</header>
<div class="heneita-content">
<form name="hanoi">
<div id="title"
style="position:absolute;visibility:visible;width:100%;height:20px;font:bold 20px Tahoma;text-align:center;">
</div>
<div id="tower1" class="container" style="left:-250px;top:-250px;width:200px;height:200px"
onmousemove="indexTo=1">
<div id="verttower1" class="towervert" style="left:99px;top:10px;width:3px;height:170px"></div>
<div id="horiztower1" class="towerhoriz" style="left:0px;top:180px;width:200px;height:2px"></div>
<div class="tower">塔1</div>
</div>
<div id="tower2" class="container" style="left:-250px;top:-250px;width:200px;height:200px"
onmousemove="indexTo=2">
<div id="verttower2" class="towervert" style="left:99px;top:10px;width:3px;height:170px"></div>
<div id="horiztower2" class="towerhoriz" style="left:0px;top:180px;width:200px;height:2px"></div>
<div class="tower">塔2</div>
</div>
<div id="tower3" class="container" style="left:-250px;top:-250px;width:200px;height:200px"
onmousemove="indexTo=3">
<div id="verttower3" class="towervert" style="left:99px;top:10px;width:3px;height:170px"></div>
<div id="horiztower3" class="towerhoriz" style="left:0px;top:180px;width:200px;height:2px"></div>
<div class="tower">塔3</div>
</div>
<div id="disk1" class="disk" style="left:-250px;top:-250px;width:50px;height:19px;background-color:pink"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 1"></div>
<div id="disk2" class="disk"
style="left:-250px;top:-250px;width:70px;height:19px;background-color:violet"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 2"></div>
<div id="disk3" class="disk"
style="left:-250px;top:-250px;width:90px;height:19px;background-color:indigo"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 3"></div>
<div id="disk4" class="disk"
style="left:-250px;top:-250px;width:110px;height:19px;background-color:blue"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 4"></div>
<div id="disk5" class="disk"
style="left:-250px;top:-250px;width:130px;height:19px;background-color:green"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 5"></div>
<div id="disk6" class="disk"
style="left:-250px;top:-250px;width:150px;height:19px;background-color:yellow"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 6"></div>
<div id="disk7" class="disk"
style="left:-250px;top:-250px;width:170px;height:19px;background-color:orange"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 7"></div>
<div id="disk8" class="disk" style="left:-250px;top:-250px;width:190px;height:19px;background-color:red"
onmousedown="initializeDrag(this,event)" onmouseup="dropDisk(this)" title="Disk 8"></div>
<div id="settings" class="container" style="left:-250px;top:-250px;width:280px;">
<table>
<tr>
<td>选择层数:</td>
<td>
<select name="diskno" onchange="newGame(this)"
onclick="prevIndex=this.options.selectedIndex">
<option value="7" selected>3</option>
<option value="15">4</option>
<option value="31">5</option>
<option value="63">6</option>
<option value="127">7</option>
<option value="255">8</option>
</select>
</td>
</tr>
<tr>
<td>最少移动次数:</td>
<td><input name="minmove" style="border:none" size="3" value="255" readonly="readonly" />
</td>
</tr>
<tr>
<td>你移动的次数:</td>
<td><input name="yourmove" style="border:none" size="3" value="0" readonly="readonly" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" name="btnIns" value="游戏规则" onclick="displayIns()" />
<input type="button" name="btnRes" value="重新开始"
onclick="newGame(document.hanoi.diskno)" />
<input type="button" name="btnUndo" value="返回操作" onclick="unDo(this)"
disabled="disabled" />
<input type="button" name="btnSolve" value="自动操作" onclick="solve(this)" />
</td>
</tr>
</table>
<p> </p>
</div>
</form>
</div>
</div>
<div class="clearfix"></div>
<div class="heneita-footer">
<div>友情↓</div>
<a href="http://www.sdmz.net/" target="_blank">四大名著</a> <a href="http://www.lssdjt.com/"
target="_blank">历史上的今天</a> <a href="http://www.mingchu.net/" target="_blank">名厨网</a> <a
href="http://www.qutonghua.com/" target="_blank">趣童话</a> <a href="http://www.klysw.com/"
target="_blank">快乐养生</a> <a href="https://www.elsfk.cn/" target="_blank">俄罗斯方块</a> <a
href="https://www.taluo.org.cn/" target="_blank">塔罗牌</a>
</div>
<div style="display:none;">
<script type="text/javascript" src="https://s96.cnzz.com/z_stat.php?id=1276162782&web_id=1276162782"></script>
</div>
</body>
</html>