-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mastermind.html
113 lines (102 loc) · 4 KB
/
Mastermind.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
<html>
<head>
<title> Mastermind </title>
<script type="text/javascript" src="Function.js"></script>
</head>
<body>
<center>
<table border="5" style="background-color:white">
<tr style="background-color:black">
<td><font color="white">
How to Play : <br/>
1. Guess 5 numbers out of 1-6. (Click the picture) <br/>
2. You have 10 chances to guess. <br/>
3. Each number can be used for more than once. <br/>
4. <font color="yellow"><b>"A"</b></font> column shows how much number that is correct but in a wrong
position. <br/>
5. <font color="green"><b>"B"</b></font> column shows how much number that is correct and in a correct
position as well.
</td>
</tr>
</table>
<br/>
<table>
<tbody align="center">
<tr>
<td width="150"><b>1</td>
<td width="150"><b>2</td>
<td width="150"><b>3</td>
<td width="150"><b>4</td>
<td width="150"><b>5</td>
<td width="150"><b>6</td>
</tr>
<tr>
<td><img src="Img1.gif" onclick="f1()"/></td>
<td><img src="Img2.gif" onclick="f2()"/></td>
<td><img src="Img3.gif" onclick="f3()"/></td>
<td><img src="Img4.gif" onclick="f4()"/></td>
<td><img src="Img5.gif" onclick="f5()"/></td>
<td><img src="Img6.gif" onclick="f6()"/></td>
</tr>
</tbody>
</table>
<b>Your answer : <br/>
<table border="1" style="background-color:black">
<tbody align="center">
<tr>
<td width="150" style="background-color:lightgray">
<div id="a"><b>0</div>
</td>
<td width="150" style="background-color:lightgray">
<div id="b"><b>0</div>
</td>
<td width="150" style="background-color:lightgray">
<div id="c"><b>0</div>
</td>
<td width="150" style="background-color:lightgray">
<div id="d"><b>0</div>
</td>
<td width="150" style="background-color:lightgray">
<div id="e"><b>0</div>
</td>
<td width="50" style="background-color:yellow"><b>A</td>
<td width="50" style="background-color:green"><b>B</td>
</tr>
<tr>
<td width="150" style="background-color:white"><img id="z" src="Marin.gif"/></td>
<td width="150" style="background-color:white"><img id="y" src="Marin.gif"/></td>
<td width="150" style="background-color:white"><img id="x" src="Marin.gif"/></td>
<td width="150" style="background-color:white"><img id="w" src="Marin.gif"/></td>
<td width="150" style="background-color:white"><img id="v" src="Marin.gif"></td>
<td width="50" style="background-color:yellow">
<div id="f"><b>0</div>
</td>
<td width="50" style="background-color:green">
<div id="g"><b>0</div>
</td>
</tr>
</tbody>
</table>
<br/>
<button type="button" onclick="submit()"> Submit</button>
<button type="button" onclick="erase()"> Erase</button>
<button type="button" onclick="restart()"> Restart</button>
<br/>
<table>
<tbody>
<tr>
<td>
Your chances :
</td>
<td>
<div id="chance"> 10</div>
</td>
</tr>
</tbody>
</table>
<p>
<div id="result"></div>
<div id="trial"></div>
<div id="answer"></div>
</body>
</html>