-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
172 lines (164 loc) · 4.75 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Play Multiplicative Nim!</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="script.js"></script>
</head>
<body>
<h1>Multiplicative Nim</h1>
<div id="grid">
<div id="play-space-wrapper">
<h2>Play!</h2>
<input
type="button"
value="Start"
onclick="start()"
id="starter"
class="button"
/>
<div id="play-space">
<div id="end-message"></div>
<div>
<span id="target-display">Target: 1000</span>
<br />
Current product:
<span id="product-display">1</span>
<br />
Previous entries:
<span id="entry-list"></span>
<br />
</div>
<div>
<input
type="number"
name="entry"
placeholder="Enter a number."
id="entry-box"
class="number-input"
/>
<input
type="button"
value="Submit"
onclick="handleEntry()"
id="submitter"
class="button"
/>
</div>
<div id="error-text"></div>
<div>
<input
type="button"
value="Start Over"
onclick="reset()"
id="resetter"
class="button"
/>
</div>
</div>
</div>
<div id="parameters-wrapper">
<h2>Parameters</h2>
<div id="parameter-mode-settings">
<span id="parameter-mode-message">Playing Classic Mode</span>
<input
type="button"
value="Set Custom Parameters"
onclick="switchParameterSetup()"
id="parameter-mode-switcher"
class="button"
/>
<br />
<span id="parameter-mode-notes"
>Switching to custom parameters will reset the game.</span
>
</div>
<div id="parameters">
<span class="parameter-headers"
>Maximum entry (must be at least 3):</span
>
<input
type="number"
value="9"
min="3"
id="max-entry"
class="number-input"
/>
<input
type="button"
value="Random"
onclick="randomizeMax()"
id="random-max"
class="button"
/>
<br />
<span class="parameter-headers"
>Target value (must be at least 10):</span
>
<input
type="number"
value="1000"
min="10"
id="target"
class="number-input"
/>
<input
type="button"
value="Random"
onclick="randomizeTarget()"
id="random-target"
class="button"
/>
<br />
<span class="parameter-headers">Win Condition:</span>
<span id="win-type-message"
>Regular -- You win if you exceed the target value.</span
>
<input
type="button"
value="Switch to Misere"
onclick="switchWinType()"
id="win-type-switcher"
class="button"
/>
<br />
<span class="parameter-headers">Mode:</span>
<span id="computer-mode-message"
>Easy -- The computer chooses values randomly.</span
>
<input
type="button"
value="Switch to Hard Mode"
onclick="switchComputerMode()"
id="computer-mode-switcher"
class="button"
/>
<br />
<input
type="button"
value="Apply Changes"
onclick="reset()"
id="parameter-applier"
class="button"
/>
</div>
</div>
<div id="instructions-wrapper">
<h2>How To Play</h2>
<p>
Enter a number (integer greater than 1) every turn in the box below.
The product starts at 1 and gets multiplied by your entry and the
computer's entry every turn. You win if the product first exceeds the
target value following your entry.<br />
Click Start to begin playing. By default, entries cannot be greater
than 9, and the computer chooses randomly. Click Set Custom Parameters
to change the maximum entry, the target value, how the computer
chooses its entries, and whether you win or lose by reaching the
target.
</p>
</div>
</div>
</body>
</html>