-
Notifications
You must be signed in to change notification settings - Fork 53
/
archive.html
278 lines (238 loc) · 10.6 KB
/
archive.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!DOCTYPE html>
<html lang="en">
<head>
<title> Scala Puzzlers </title>
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/prettify.css" type="text/css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/prettify.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31486114-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body data-spy="scroll" data-target=".subnav" data-offset="50">
<!-- Navbar
================================================== -->
<div class="navbar navbar-fixed-top">
<a target="_blank" href="https://github.com/scalapuzzlers/scalapuzzlers.github.com">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub">
</a>
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/">Scala ?uzz<img src="img/l.png" alt="l" style="padding-bottom:10px;padding-left:2px;padding-right:2px"/>ers</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li>
<a id="navbar-home" href="index.html">Home</a>
</li>
<li>
<a id="navbar-archive" href="archive.html">Archive</a>
</li>
<li>
<a id="navbar-contribute" href="contribute.html">How to Contribute</a>
</li>
<li>
<a id="navbar-contact" href="contact.html">Contact</a>
</li>
<li>
<a id="navbar-about" href="about.html">About</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<script type="text/javascript">
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
var pathToID = {
"/" : '#navbar-home',
"index.html" : '#navbar-home',
"archive.html" : '#navbar-archive',
"contribute.html" : '#navbar-contribute',
"contact.html" : '#navbar-contact',
"about.html" : '#navbar-about'
};
$(document).ready(function() {
function mapPathToID(path) {
var key;
var id = null;
for (key in pathToID) {
if (path === key) {
id = pathToID[key];
break;
}
}
return id;
};
var id = mapPathToID(window.location.pathname);
if (id != null) {
$(id).addClass("active");
}
});
/* * * DISQUS CONFIGURATION VARIABLES * * */
var disqus_shortname = 'scalapuzzlers'; // required: replace example with your forum shortname
var disqus_identifier = 'elem.id';
var disqus_url = 'https://scalapuzzlers.com/!#/' + 'elem.id';
var disqus_title = $('#title').find("h1").text();
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Puzzlers</li>
<li class="nav-header">2.13</li>
<li><a href="#" id="pzzlr-030">Double Trouble</a></li>
<li><a href="#" id="pzzlr-052">Partial Oddity</a></li>
<li><a href="#" id="pzzlr-062">Identity Crisis</a></li>
<li><a href="#" id="pzzlr-064">Traversing Travesty</a></li>
<li><a href="#" id="pzzlr-071">Repeat After Me</a></li>
<li class="nav-header">2.12</li>
<li><a href="#" id="pzzlr-025">$!.*% Iterators!</a></li>
<li><a href="#" id="pzzlr-050">Extract or Fail?</a></li>
<li class="nav-header">2.11</li>
<li><a href="#" id="pzzlr-038">What Were You Expecting?</a></li>
<li class="nav-header">2.9</li>
<li><a href="#" id="pzzlr-002">Match Me</a></li>
<li><a href="#" id="pzzlr-031">Double Take</a></li>
<li class="divider"></li>
</ul>
</div><!--/.well -->
</div><!--/span3-->
<script type="text/javascript">
var activeElem = null;
$('a[id|="pzzlr"]').each(function(index, elem) {
$(elem).click(function() {
$('#disqus_thread').hide();
$('#prime-space').html("");
$('#prime-space').load('puzzlers/' + elem.id + '.html', function() {
prettyPrint();
document.location.hash = elem.id;
window.scrollTo(0, 0);
$('#show-and-tell').click(function() {
$('#show-and-tell').addClass("disabled");
$('#correct-answer').addClass("correct-answer");
$('#explanation').show('slow', function () {
DISQUS.reset({
reload: true,
config: function () {
this.page.identifier = elem.id;
this.page.url = 'https://scalapuzzlers.com/#!/' + elem.id;
this.page.title = $('#title').find("h1").text();
}
});
$('#disqus_thread').show();
$('html,body').animate({scrollTop:$('#correct-answer').offset().top - $('.navbar').height() - 2}, 900);
});
});
});
if (activeElem != null) {
$(activeElem).removeClass("active");
}
activeElem = $(elem).parent();
$(activeElem).addClass("active");
});
});
</script>
<div class="span9">
<div id="prime-space">
<div id="welcome-content" style="display:none">
<div class="headline">
<h1>A fun way to learn more about
<img src="img/scala-logo.png" alt="Scala" style="padding-bottom:15px;padding-left:10px"/></h1><br/>
<p>Welcome to the Scala Puzzlers archive, the collection of <i>Traps, Pitfalls and Corner Cases</i> in older versions of the Scala language.<br/><br/>
Prepare to be surprised, entertained and...well, puzzled! What is presented here is a selection of seemingly simple examples which demonstrate that there's plenty of head-scratching left in Scala. Let your mind be challenged by unexpected and unintuitive behaviour and results and learn something in the process.
<br/><br/>
Choose a puzzler from the left-hand list to get started!</p>
</div>
<div class="row-fluid">
<div class="span6 headline-unit">
<h2>Your contributions are welcomed</h2>
<p>Scala Puzzlers is a community effort! Have a puzzler you would like to share with the rest of the Scala community? Please follow <a href="/contribute.html">these instructions</a> to submit your puzzler.
And don't worry, you will be properly credited for your contribution!</p>
</div>
<div class="span6 headline-unit">
<h2>We would love to hear from you</h2>
<p>Any kind of feedback is appreciated, about the website but also about the puzzlers themselves. If there is something you would like to let us know, please <a href="/contact.html">contact us</a>.
</p>
</div>
</div><!--/row-fluid-->
<footer class="footer">
Copyright © 2013, Andrew Phillips and Nermin Serifovic
</footer>
</div><!--/welcome-->
</div><!--/prime-space-->
<div id="disqus_thread" class="comments"></div>
</div><!--/span9-->
</div><!--/raw-fluid-->
</div><!--/container-fluid-->
<script type="text/javascript">
$('#disqus_thread').hide();
if (document.location.hash) {
var elem = $(document.location.hash)[0]
$('#prime-space').load('puzzlers/' + elem.id + '.html', function() {
prettyPrint();
window.scrollTo(0, 0);
$('#show-and-tell').click(function() {
$('#show-and-tell').addClass("disabled");
$('#correct-answer').addClass("correct-answer");
$('#explanation').show('slow', function() {
disqus_identifier = elem.id;
disqus_url = 'https://scalapuzzlers.com/#!/' + elem.id;
disqus_title = $('#title').find("h1").text();
DISQUS.reset({
reload: true,
config: function () {
this.page.identifier = elem.id;
this.page.url = 'https://scalapuzzlers.com/#!/' + elem.id;
this.page.title = $('#title').find("h1").text();
}
});
$('#disqus_thread').show();
$('html,body').animate({scrollTop:$('#correct-answer').offset().top - $('.navbar').height() - 2}, 900);
});
});
});
if (activeElem != null) {
$(activeElem).removeClass("active");
}
activeElem = $(elem).parent();
$(activeElem).addClass("active");
} else {
$('#welcome-content').show();
$('#disqus_thread').hide();
}
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31486114-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>