forked from thejoshwolfe/stop-thief
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (56 loc) · 4.53 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
<html>
<head><title>Stop Thief</title></head>
<body>
<div id="mapDiv">
<table><tr>
<td><canvas id="mapCanvas" width=1 height=1></canvas></td>
<td><div>
<label><input id="showMovementGraphCheckbox" type="checkbox" checked> Show Movement Graph</label><br>
<label><input id="showThiefMovementCheckbox" type="checkbox" checked> Show Thief Movement</label>
</div></td>
</tr></table>
</div>
<div>
<input id="clueButton" type="button" value="Clue">
</div>
<div id="currentMoveDiv" style="font-size: 400%;"></div>
<ul id="historyUl" style="padding: 0px; list-style-type: none;"></ul>
<input id="showMovementRulesButton" type="button" value="Hide Movement Rules">
<div id="movementRulesDiv">
Thief movement rules (in this order):
<ol>
<li>For each CLUE, the thief will either MOVE or WAIT.</li>
<li>(TODO: implement the subway) For each MOVE, the thief will always use the SUBWAY if the thief is on one of the 5 STREET spaces with SUBWAY access, unless the thief has just used the SUBWAY 1 MOVE ago. While using the SUBWAY, the thief cannot be arrested, and a TIP cannot be used. The MOVE after using the SUBWAY is always 1 of the 5 STREET spaces with SUBWAY access (Note: this can be the same STREET space where the thief was 1 MOVE ago.) The next MOVE never uses the SUBWAY (otherwise, the thief would never get away from the subway.).</li>
<li>For each MOVE, if the thief has just moved onto a DOOR or WINDOW, the thief will continue through to the other side.</li>
<li>For each MOVE, the thief can move up to 2 board spaces in any direction (including diagonally) to land on a numbered space. If the thief steps onto the street during a MOVE, the thief will stop on a street space; in other words, the thief cannot leap across the street into the door or window of another building in a single MOVE. This establishes the set of available spaces.</li>
<li>For each MOVE, if there are 1 or more available unused indoor CRIME spaces, the thief will choose randomly from among them and move to it (TODO: don't consider the NEWS STAND an irresistible crime space.). A used indoor CRIME space is considered a FLOOR space until it is restocked, and a used outdoor CRIME space (the NEWS STAND) is considered a STREET space until it is restocked (TODO: currently it's considered a floor space.). Indoor CRIME spaces are restocked when the thief leaves the building (TODO: implement restocking.); the NEWS STAND is restocked after the thief COMPLIES with a CORRECT ARREST.</li>
<li>For each MOVE, the thief will never move into a numbered space where the thief was last turn, a direct U-turn. (But the thief can move into a space where the thief was 2 turns ago, making a triangle.) (Remember that a CRIME space turns into a FLOOR or STREET space until the CRIME space is restocked.)</li>
<li>For each MOVE, if none of the above rules have determined the thief's movement space, the thief will choose one of the available spaces randomly.</li>
<li>(TODO: implement arresting.) After an INCORRECT ARREST, the thief will do nothing.</li>
<li>After a CORRECT ARREST, the thief will either COMPLY or RUN.</li>
<li>(TODO: implement running.) For each RUN, the thief will MOVE 5 or 6 times.</li>
</ol>
More TODOs:
<ul>
<li>TODO: add styling/formatting so this text doesn't look so atrocious.</li>
<li>TODO: show building numbers on the map, and have an overlay that shows the ids of all thief spaces.</li>
<li>TODO: implement TIP.</li>
<li>TODO: persist state through refreshes.</li>
<li>TODO: allow starting a new game (without refreshing the page).</li>
<li>TODO: disallow starting on the news stand.</li>
<li>TODO: enable the thief to delay getting a crime as long as its still 1 space away.</li>
<li>TODO: hide building number when running.</li>
</ul>
</div>
<input id="showProbabilitiesButton" type="button" value="Hide Probabilities">
<div id="probabilitiesDiv">
Probabilities (TODO: changing these values currently has no effect.):
<ul>
<li><label>Chance to MOVE on each CLUE: <input id="moveChanceTextbox" value="0.75"></label></li>
<li><label>Chance to COMPLY on each CORRECT ARREST: <input id="moveChanceTextbox" value="0.5"></label></li>
<li><label>Chance to MOVE an extra time on each RUN: <input id="moveChanceTextbox" value="0.5"></label></li>
</ul>
</div>
<script src="a.js"></script>
</body>
</html>