-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
167 lines (163 loc) · 4.96 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
<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/puzzle-utils.js"></script>
<script src="js/deeDum.js"></script>
<title>Identical Twins</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 puzzleData = [];
let puzzle = null;
//load data
$(document).ready(function(){
console.log("about to fetch remote data");
$.getJSON("data/deeDum.json", function(data){
puzzleData = data;
}).done(function() {
initialize();
set();
});
});
//associated display elements
$(document).ready(function(){
$("#resetButton").on("click", function(){
reset();
});
$("#solve").on("click", function(event){
if (display.disabled) return;
$("#reset").addClass("btn-success");
solvePuzzle();
});
$("#explain").on("click", function(event){
$("#reset").addClass("btn-success");
display.disabled = true;
explainPuzzle();
});
display.puzzleIntro = document.getElementById("puzzleIntro");
display.solutionDisplay = document.getElementById("solutionDisplay");
display.puzzleDescription = document.getElementById("puzzleDescription");
display.goalDisplay = document.getElementById("goalDisplay");
display.puzzleTitle = document.getElementById("puzzleTitle");
display.explanationDisplay = document.getElementById("explanationDisplay");
});
function initialize(){
deeDum.puzzles = puzzleData;
}
function set(){
puzzleReset(window.location.href);
}
function reset() {
puzzleReset();
};
</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>Identical Twins</h1>
</div>
<p class='puzzle-text'>
<em>Some logic puzzles inspired by those found in Raymond Smullyan's <strong>Alice in Puzzle-Land</strong>.</em>
</p>
<button type='button'
class='btn btn-info' data-toggle='collapse' data-target='#mainText'>
About </button>
<div id='mainText' class='collapse'> <br>
<p class='puzzle-text'>
Click the <strong>Solve</strong>
button to confirm your selection. If you are stumped, use the <strong>Reveal Explanation
</strong> button (once this is clicked, you can no longer submit a solution).
</p>
</div>
<hr>
<h2 id="puzzleTitle"></h2>
<div class='puzzle-text'>
<p>
Alice stumbled on Tweedledum and Tweedledee who were grinning under a tree right by their house. Tweedledee and Tweedledum appear identical, and Alice could not tell them apart. "Let's play a logic game," said the first brother. Holding up a Jack of Diamonds, the first brother continued: "We will go back inside and each pick up a playing card like this and keep it hidden from you. When we hold a red card, we will tell the truth, when we hold a black card we will lie." He added, "Remember, when we say 'Either A or B,' we are using 'or' inclusively, which means either A or B or both!" With that, the two brothers entered their home.
</p>
<p>
The two brothers came out of their house and said this to Alice:
</p>
</div>
<div id="puzzleIntro" class='puzzle-text'></div>
<hr>
<div id="goalDisplay"></div>
<br>
<div id="explainButton">
<button type="button" id="explain" class="btn btn-primary typeButton">Reveal Explanation</span></button>
</div>
<div id="explanationDisplay" class="puzzle-text"></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/john_tenniel.jpg" style="max-width:380px" >
<br>
<p> <em>Illustration by <a href='https://en.wikipedia.org/wiki/John Tenniel'>John Tenniel</a>.</em></p>
<br>
</div>
<div class='col-sm-1 col-lg-3'></div>
</div>
</div>
</div>
</body>
</html>