-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
194 lines (184 loc) · 5.5 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/craig-util.js"></script>
<script src="js/craig-parse.js"></script>
<script src="js/craig.js"></script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<title>Inspector Craig</title>
</head>
<style>
ul {
padding-left: 40px;
list-style-type: none;
}
li {
padding-bottom: 10px;
}
table, tr {
padding: 4px;
text-align: center;
border: 1px solid black;
border-collapse: collapse;
margin: auto;
}
th, td {
padding: 10px;
}
.buttonDiv {
display: inline-block;
padding: 2px;
border: 2px;
}
.centered {
text-align: center;
}
.prop-column {
font-size:large;
}
.main-column {
background-color:white;
}
</style>
<script>
let craig3Data = [];
let craig4Data = [];
let puzzle = null;
//load data
$(document).ready(function(){
console.log("about to fetch remote data");
$.getJSON("data/craig3.json", function(data){
craig3Data = data;
}).done(function() {
initialize();
reset();
});
$.getJSON("data/craig4.json", function(data){
craig4Data = data;
});
});
//initialize display
$(document).ready(function(){
$("#resetButton").on("click", function(){
reset();
});
$("#solve").on("click", function(event){
if (display.disabled) return;
$("#reset").addClass("btn-success");
solvePuzzle();
});
$(".puzzleTypeBtn").on("click", function(event) {
let id = event.currentTarget.id;
if (id === "1"){
craig.puzzles = craig3Data;
} else if (id === "2"){
craig.puzzles = craig4Data;
}
resetPuzzleFolder();
reset();
$(".puzzleTypeBtn").removeClass("btn-primary");
$(".puzzleTypeBtn").removeClass("btn-secondary");
$(".puzzleTypeBtn").addClass("btn-secondary");
$("#" + id).addClass("btn-primary");
$("#" + id).removeClass("btn-secondary");
});
display.puzzleIntro = document.getElementById("puzzleIntro");
display.solutionDisplay = document.getElementById("solutionDisplay");
display.puzzleDescription = document.getElementById("puzzleDescription");
display.suspectDisplay = document.getElementById("suspectDisplay");
display.puzzleTitle = document.getElementById("puzzleTitle");
display.latexDisplay = document.getElementById("latexDisplay");
});
function initialize(){
craig.puzzles = craig3Data;
}
function reset() {
puzzleReset();
MathJax.Hub.Typeset();
};
</script>
<body>
<nav class="navbar navbar-default" style="margin-bottom:0px">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="..">
<img src="imgs/github_badge1.png" style="max-width:100%;max-height:100%" >
</a>
<p class="navbar-text navbar-right">
<a href=".." class="navbar-link">dmackinnon1.github.io</a>
</p>
</div>
</div>
</nav>
<div class="container-fluid">
<div class='row'>
<div class='col-sm-1 col-lg-3'></div>
<div class='col-sm-10 col-lg-6 main-column'>
<div class="page-header">
<h1>The Case Files of Inspector Craig</h1>
</div>
<p class='puzzle-text'>
Raymond Smullyan's book of puzzles "What is the Name of this Book?" introduced the logical detective Inspector Leslie Craig of Scotland Yard. On this page, Inspector Craig has provided some
additional case files "for the benefit of those interested in the application of logic to the
solution of crimes."
</p>
<p class='puzzle-text'>
For each case history, determine if the evidence supports the guilt or innocence of each suspect, or that the evidence does not allow a determination.
</p>
<hr>
<div class="centered">
<div class="btn-group btn-group-md " role="group">
<button type="button" id="1" class="puzzleTypeBtn btn btn-primary">Folder 1</button>
<button type="button" id="2" class="puzzleTypeBtn btn btn-secondary">Folder 2</button>
</div>
</div>
<hr>
<h2 id="puzzleTitle"></h2>
<div id="puzzleIntro" class='puzzle-text'></div>
<div id="puzzleDescription" class='puzzle-text'></div>
<button type='button' class='btn btn-info' data-toggle='collapse' data-target='#latexDisplayHolder'>
Show Propositions </button>
<div id='latexDisplayHolder' class='collapse'>
<br>
<p><em>The statements of evidence can be translated into logical formulae - if you are familiar with
the notation, this might help you solve the case.</em></p>
<div id='latexDisplay'></div>
</div>
<hr>
<div id="suspectDisplay"></div>
<br>
<div id="soveButton">
<button type="button" id="solve" class="btn btn-primary typeButton">Solve</span></button>
</div>
<br>
<div id="solutionDisplay" class="puzzle-text"></div>
<hr>
<div id="resetButtonHolder">
<button type="button" id="resetButton", class="btn btn-primary typeButton">New Puzzle</span></button>
</div>
<br>
<div class='centered'>
<img src="imgs/holmes.png" style="max-width:357px;max-height:252px" >
<br>
<p> <em>Illustration from <a href='https://books.google.ca/books?id=buc0AAAAMAAJ'>Adventures of Sherlock Holmes</a>, <br> by Sir Arthur Conan Doyle (1892).</em></p>
<br>
</div>
<!--
https://books.google.ca/books?id=buc0AAAAMAAJ
Adventures of Sherlock Holmes
Sir Arthur Conan Doyle
A.L. Burt Company, 1892
-->
</div>
<div class='col-sm-1 col-lg-3'></div>
</div>
</div>
</body>
</html>