forked from code-golf/code-golf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
holes.toml
2001 lines (1831 loc) · 67.5 KB
/
holes.toml
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# TODO
#
# Art
# - Swallowed a Fly
#
# Computing
# - Deadfish
#
# Mathematics
# - γ (Euler–Mascheroni constant)
# - K (Khinchin's constant)
#
# Sequence
# - Fortunate Numbers
# - Lucky Numbers
# - Lucky Primes
# - Perfect Numbers
# - Semiprime Numbers
# - Sphenic Numbers
# - Triangular Numbers
#
# Transform
# - ISBN Check Digit
# - £sd
['12 Days of Christmas']
category = 'Art'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/The_Twelve_Days_of_Christmas' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/The_Twelve_Days_of_Christmas_(song)' },
]
preamble = '''
<p>Print the lyrics to the song <b>The 12 Days of Christmas</b>:</p>
<blockquote>On the First day of Christmas
My true love sent to me
A Partridge in a Pear Tree.
…
On the Twelfth day of Christmas
My true love sent to me
Twelve Drummers Drumming,
Eleven Pipers Piping,
Ten Lords-a-Leaping,
Nine Ladies Dancing,
Eight Maids-a-Milking,
Seven Swans-a-Swimming,
Six Geese-a-Laying,
Five Gold Rings,
Four Calling Birds,
Three French Hens,
Two Turtle Doves, and
A Partridge in a Pear Tree.
</blockquote>
'''
['99 Bottles of Beer']
category = 'Art'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/99_Bottles_of_Beer' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/99_Bottles_of_Beer' },
]
preamble = '''
<p>Print the lyrics to the song <b>99 Bottles of Beer</b>:</p>
<blockquote>99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of beer on the wall.
…
1 bottle of beer on the wall, 1 bottle of beer.
Take one down and pass it around, no more bottles of beer on the wall.
No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
</blockquote>
'''
['Abundant Numbers']
category = 'Sequence'
links = [
{ name = 'OEIS A005101', url = '//oeis.org/A005101' },
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Abundant,_deficient_and_perfect_number_classifications' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Abundant_number' },
]
preamble = '''
<p>
An abundant number is a number for which the sum of its proper divisors
(divisors not including the number itself) is greater than the number
itself. For example <b>12</b> is abundant because its proper divisors are
<b>1</b>, <b>2</b>, <b>3</b>, <b>4</b>, and <b>6</b> which add up to
<b>16</b>.
<p>
Print all the abundant numbers from <b>1</b> to <b>200</b> inclusive, each
on their own line.
'''
['Arabic to Roman']
category = 'Transform'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Roman_numerals/Encode' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Roman_numerals' },
]
preamble = '''
<p>For each Arabic numeral argument print the same number in Roman numerals.
'''
[brainfuck]
category = 'Computing'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Execute_Brain****' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Brainfuck' },
]
preamble = '''
<p>
Brainfuck is a minimalistic esoteric programming language created by
Urban Müller in 1993.
<p>
Assuming an infinitely large array, the entire brainfuck alphabet matches
the following pseudocode:
<div>
<table>
<thead>
<tr>
<th>Cmd
<th>Pseudocode
<tbody>
<tr>
<th>>
<td>ptr++
<tr>
<th><
<td>ptr--
<tr>
<th>+
<td>array[ptr]++
<tr>
<th>-
<td>array[ptr]--
<tr>
<th>.
<td>print(chr(array[ptr]))
<tr>
<th>[
<td>while(array[ptr]){
<tr>
<th>]
<td>}
</table>
</div>
<p>
Write a program that will receive various brainfuck programs as arguments
and execute each program in turn.
'''
['Christmas Trees']
category = 'Art'
preamble = '''
<p>
Print a size ascending range of Christmas trees using asterisks, ranging
from size <b>3</b> to size <b>9</b>, each tree separated by a blank line.
<p>
A size <b>3</b> tree should look like this, with a single centered
asterisk for the trunk:
<pre> *
***
*****
*
</pre>
<p>With the largest size <b>9</b> tree looking like this:
<pre> *
***
*****
*******
*********
***********
*************
***************
*****************
*
</pre>
'''
['CSS Colors']
category = 'Transform'
preamble = '''
<svg class=hide>
<symbol id="color" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/symbol">
<rect width="1" height="1"/>
</symbol>
</svg>
Given each CSS color keyword print the corresponding hex value. The output
will be checked case-insensitively. The full mapping is as follows:
<div id=colors>
<table>
<thead>
<tr><th>Keyword<th>Hex
<tbody>
<tr><td><svg><use fill="#cd5c5c" href="#color"/></svg>IndianRed
<td>#cd5c5c
<tr><td><svg><use fill="#f08080" href="#color"/></svg>LightCoral
<td>#f08080
<tr><td><svg><use fill="#fa8072" href="#color"/></svg>Salmon
<td>#fa8072
<tr><td><svg><use fill="#e9967a" href="#color"/></svg>DarkSalmon
<td>#e9967a
<tr><td><svg><use fill="#ffa07a" href="#color"/></svg>LightSalmon
<td>#ffa07a
<tr><td><svg><use fill="#ff0000" href="#color"/></svg>Red
<td>#ff0000
<tr><td><svg><use fill="#dc143c" href="#color"/></svg>Crimson
<td>#dc143c
<tr><td><svg><use fill="#b22222" href="#color"/></svg>FireBrick
<td>#b22222
<tr><td><svg><use fill="#8b0000" href="#color"/></svg>DarkRed
<td>#8b0000
<tr><td><svg><use fill="#ffc0cb" href="#color"/></svg>Pink
<td>#ffc0cb
<tr><td><svg><use fill="#ffb6c1" href="#color"/></svg>LightPink
<td>#ffb6c1
<tr><td><svg><use fill="#ff69b4" href="#color"/></svg>HotPink
<td>#ff69b4
<tr><td><svg><use fill="#ff1493" href="#color"/></svg>DeepPink
<td>#ff1493
<tr><td><svg><use fill="#c71585" href="#color"/></svg>MediumVioletRed
<td>#c71585
<tr><td><svg><use fill="#db7093" href="#color"/></svg>PaleVioletRed
<td>#db7093
<tr><td><svg><use fill="#ff7f50" href="#color"/></svg>Coral
<td>#ff7f50
<tr><td><svg><use fill="#ff6347" href="#color"/></svg>Tomato
<td>#ff6347
<tr><td><svg><use fill="#ff4500" href="#color"/></svg>OrangeRed
<td>#ff4500
<tr><td><svg><use fill="#ff8c00" href="#color"/></svg>DarkOrange
<td>#ff8c00
<tr><td><svg><use fill="#ffa500" href="#color"/></svg>Orange
<td>#ffa500
<tr><td><svg><use fill="#ffd700" href="#color"/></svg>Gold
<td>#ffd700
<tr><td><svg><use fill="#ffff00" href="#color"/></svg>Yellow
<td>#ffff00
<tr><td><svg><use fill="#ffffe0" href="#color"/></svg>LightYellow
<td>#ffffe0
<tr><td><svg><use fill="#fffacd" href="#color"/></svg>LemonChiffon
<td>#fffacd
<tr><td><svg><use fill="#fafad2" href="#color"/></svg>LightGoldenRodYellow
<td>#fafad2
<tr><td><svg><use fill="#ffefd5" href="#color"/></svg>PapayaWhip
<td>#ffefd5
<tr><td><svg><use fill="#ffe4b5" href="#color"/></svg>Moccasin
<td>#ffe4b5
<tr><td><svg><use fill="#ffdab9" href="#color"/></svg>PeachPuff
<td>#ffdab9
<tr><td><svg><use fill="#eee8aa" href="#color"/></svg>PaleGoldenRod
<td>#eee8aa
<tr><td><svg><use fill="#f0e68c" href="#color"/></svg>Khaki
<td>#f0e68c
<tr><td><svg><use fill="#bdb76b" href="#color"/></svg>DarkKhaki
<td>#bdb76b
<tr><td><svg><use fill="#e6e6fa" href="#color"/></svg>Lavender
<td>#e6e6fa
<tr><td><svg><use fill="#d8bfd8" href="#color"/></svg>Thistle
<td>#d8bfd8
<tr><td><svg><use fill="#dda0dd" href="#color"/></svg>Plum
<td>#dda0dd
<tr><td><svg><use fill="#ee82ee" href="#color"/></svg>Violet
<td>#ee82ee
<tr><td><svg><use fill="#da70d6" href="#color"/></svg>Orchid
<td>#da70d6
<tr><td><svg><use fill="#ff00ff" href="#color"/></svg>Fuchsia
<td>#ff00ff
</table>
<table>
<thead>
<tr><th>Keyword<th>Hex
<tbody>
<tr><td><svg><use fill="#ff00ff" href="#color"/></svg>Magenta
<td>#ff00ff
<tr><td><svg><use fill="#ba55d3" href="#color"/></svg>MediumOrchid
<td>#ba55d3
<tr><td><svg><use fill="#9370db" href="#color"/></svg>MediumPurple
<td>#9370db
<tr><td><svg><use fill="#8a2be2" href="#color"/></svg>BlueViolet
<td>#8a2be2
<tr><td><svg><use fill="#9400d3" href="#color"/></svg>DarkViolet
<td>#9400d3
<tr><td><svg><use fill="#9932cc" href="#color"/></svg>DarkOrchid
<td>#9932cc
<tr><td><svg><use fill="#8b008b" href="#color"/></svg>DarkMagenta
<td>#8b008b
<tr><td><svg><use fill="#800080" href="#color"/></svg>Purple
<td>#800080
<tr><td><svg><use fill="#4b0082" href="#color"/></svg>Indigo
<td>#4b0082
<tr><td><svg><use fill="#483d8b" href="#color"/></svg>DarkSlateBlue
<td>#483d8b
<tr><td><svg><use fill="#6a5acd" href="#color"/></svg>SlateBlue
<td>#6a5acd
<tr><td><svg><use fill="#7b68ee" href="#color"/></svg>MediumSlateBlue
<td>#7b68ee
<tr><td><svg><use fill="#663399" href="#color"/></svg>RebeccaPurple
<td>#663399
<tr><td><svg><use fill="#adff2f" href="#color"/></svg>GreenYellow
<td>#adff2f
<tr><td><svg><use fill="#7fff00" href="#color"/></svg>Chartreuse
<td>#7fff00
<tr><td><svg><use fill="#7cfc00" href="#color"/></svg>LawnGreen
<td>#7cfc00
<tr><td><svg><use fill="#00ff00" href="#color"/></svg>Lime
<td>#00ff00
<tr><td><svg><use fill="#32cd32" href="#color"/></svg>LimeGreen
<td>#32cd32
<tr><td><svg><use fill="#98fb98" href="#color"/></svg>PaleGreen
<td>#98fb98
<tr><td><svg><use fill="#90ee90" href="#color"/></svg>LightGreen
<td>#90ee90
<tr><td><svg><use fill="#00ff7f" href="#color"/></svg>SpringGreen
<td>#00ff7f
<tr><td><svg><use fill="#00fa9a" href="#color"/></svg>MediumSpringGreen
<td>#00fa9a
<tr><td><svg><use fill="#3cb371" href="#color"/></svg>MediumSeaGreen
<td>#3cb371
<tr><td><svg><use fill="#2e8b57" href="#color"/></svg>SeaGreen
<td>#2e8b57
<tr><td><svg><use fill="#228b22" href="#color"/></svg>ForestGreen
<td>#228b22
<tr><td><svg><use fill="#008000" href="#color"/></svg>Green
<td>#008000
<tr><td><svg><use fill="#006400" href="#color"/></svg>DarkGreen
<td>#006400
<tr><td><svg><use fill="#9acd32" href="#color"/></svg>YellowGreen
<td>#9acd32
<tr><td><svg><use fill="#6b8e23" href="#color"/></svg>OliveDrab
<td>#6b8e23
<tr><td><svg><use fill="#808000" href="#color"/></svg>Olive
<td>#808000
<tr><td><svg><use fill="#556b2f" href="#color"/></svg>DarkOliveGreen
<td>#556b2f
<tr><td><svg><use fill="#66cdaa" href="#color"/></svg>MediumAquamarine
<td>#66cdaa
<tr><td><svg><use fill="#8fbc8f" href="#color"/></svg>DarkSeaGreen
<td>#8fbc8f
<tr><td><svg><use fill="#20b2aa" href="#color"/></svg>LightSeaGreen
<td>#20b2aa
<tr><td><svg><use fill="#008b8b" href="#color"/></svg>DarkCyan
<td>#008b8b
<tr><td><svg><use fill="#008080" href="#color"/></svg>Teal
<td>#008080
<tr><td><svg><use fill="#00ffff" href="#color"/></svg>Aqua
<td>#00ffff
</table>
<table>
<thead>
<tr><th>Keyword<th>Hex
<tbody>
<tr><td><svg><use fill="#00ffff" href="#color"/></svg>Cyan
<td>#00ffff
<tr><td><svg><use fill="#e0ffff" href="#color"/></svg>LightCyan
<td>#e0ffff
<tr><td><svg><use fill="#afeeee" href="#color"/></svg>PaleTurquoise
<td>#afeeee
<tr><td><svg><use fill="#7fffd4" href="#color"/></svg>Aquamarine
<td>#7fffd4
<tr><td><svg><use fill="#40e0d0" href="#color"/></svg>Turquoise
<td>#40e0d0
<tr><td><svg><use fill="#48d1cc" href="#color"/></svg>MediumTurquoise
<td>#48d1cc
<tr><td><svg><use fill="#00ced1" href="#color"/></svg>DarkTurquoise
<td>#00ced1
<tr><td><svg><use fill="#5f9ea0" href="#color"/></svg>CadetBlue
<td>#5f9ea0
<tr><td><svg><use fill="#4682b4" href="#color"/></svg>SteelBlue
<td>#4682b4
<tr><td><svg><use fill="#b0c4de" href="#color"/></svg>LightSteelBlue
<td>#b0c4de
<tr><td><svg><use fill="#b0e0e6" href="#color"/></svg>PowderBlue
<td>#b0e0e6
<tr><td><svg><use fill="#add8e6" href="#color"/></svg>LightBlue
<td>#add8e6
<tr><td><svg><use fill="#87ceeb" href="#color"/></svg>SkyBlue
<td>#87ceeb
<tr><td><svg><use fill="#87cefa" href="#color"/></svg>LightSkyBlue
<td>#87cefa
<tr><td><svg><use fill="#00bfff" href="#color"/></svg>DeepSkyBlue
<td>#00bfff
<tr><td><svg><use fill="#1e90ff" href="#color"/></svg>DodgerBlue
<td>#1e90ff
<tr><td><svg><use fill="#6495ed" href="#color"/></svg>CornflowerBlue
<td>#6495ed
<tr><td><svg><use fill="#4169e1" href="#color"/></svg>RoyalBlue
<td>#4169e1
<tr><td><svg><use fill="#0000ff" href="#color"/></svg>Blue
<td>#0000ff
<tr><td><svg><use fill="#0000cd" href="#color"/></svg>MediumBlue
<td>#0000cd
<tr><td><svg><use fill="#00008b" href="#color"/></svg>DarkBlue
<td>#00008b
<tr><td><svg><use fill="#000080" href="#color"/></svg>Navy
<td>#000080
<tr><td><svg><use fill="#191970" href="#color"/></svg>MidnightBlue
<td>#191970
<tr><td><svg><use fill="#fff8dc" href="#color"/></svg>Cornsilk
<td>#fff8dc
<tr><td><svg><use fill="#ffebcd" href="#color"/></svg>BlanchedAlmond
<td>#ffebcd
<tr><td><svg><use fill="#ffe4c4" href="#color"/></svg>Bisque
<td>#ffe4c4
<tr><td><svg><use fill="#ffdead" href="#color"/></svg>NavajoWhite
<td>#ffdead
<tr><td><svg><use fill="#f5deb3" href="#color"/></svg>Wheat
<td>#f5deb3
<tr><td><svg><use fill="#deb887" href="#color"/></svg>Burlywood
<td>#deb887
<tr><td><svg><use fill="#d2b48c" href="#color"/></svg>Tan
<td>#d2b48c
<tr><td><svg><use fill="#bc8f8f" href="#color"/></svg>RosyBrown
<td>#bc8f8f
<tr><td><svg><use fill="#f4a460" href="#color"/></svg>SandyBrown
<td>#f4a460
<tr><td><svg><use fill="#daa520" href="#color"/></svg>GoldenRod
<td>#daa520
<tr><td><svg><use fill="#b8860b" href="#color"/></svg>DarkGoldenRod
<td>#b8860b
<tr><td><svg><use fill="#cd853f" href="#color"/></svg>Peru
<td>#cd853f
<tr><td><svg><use fill="#d2691e" href="#color"/></svg>Chocolate
<td>#d2691e
<tr><td><svg><use fill="#8b4513" href="#color"/></svg>SaddleBrown
<td>#8b4513
</table>
<table>
<thead>
<tr><th>Keyword<th>Hex
<tbody>
<tr><td><svg><use fill="#a0522d" href="#color"/></svg>Sienna
<td>#a0522d
<tr><td><svg><use fill="#a52a2a" href="#color"/></svg>Brown
<td>#a52a2a
<tr><td><svg><use fill="#800000" href="#color"/></svg>Maroon
<td>#800000
<tr><td><svg><use fill="#ffffff" href="#color"/></svg>White
<td>#ffffff
<tr><td><svg><use fill="#fffafa" href="#color"/></svg>Snow
<td>#fffafa
<tr><td><svg><use fill="#f0fff0" href="#color"/></svg>Honeydew
<td>#f0fff0
<tr><td><svg><use fill="#f5fffa" href="#color"/></svg>MintCream
<td>#f5fffa
<tr><td><svg><use fill="#f0ffff" href="#color"/></svg>Azure
<td>#f0ffff
<tr><td><svg><use fill="#f0f8ff" href="#color"/></svg>AliceBlue
<td>#f0f8ff
<tr><td><svg><use fill="#f8f8ff" href="#color"/></svg>GhostWhite
<td>#f8f8ff
<tr><td><svg><use fill="#f5f5f5" href="#color"/></svg>WhiteSmoke
<td>#f5f5f5
<tr><td><svg><use fill="#fff5ee" href="#color"/></svg>SeaShell
<td>#fff5ee
<tr><td><svg><use fill="#f5f5dc" href="#color"/></svg>Beige
<td>#f5f5dc
<tr><td><svg><use fill="#fdf5e6" href="#color"/></svg>OldLace
<td>#fdf5e6
<tr><td><svg><use fill="#fffaf0" href="#color"/></svg>FloralWhite
<td>#fffaf0
<tr><td><svg><use fill="#fffff0" href="#color"/></svg>Ivory
<td>#fffff0
<tr><td><svg><use fill="#faebd7" href="#color"/></svg>AntiqueWhite
<td>#faebd7
<tr><td><svg><use fill="#faf0e6" href="#color"/></svg>Linen
<td>#faf0e6
<tr><td><svg><use fill="#fff0f5" href="#color"/></svg>LavenderBlush
<td>#fff0f5
<tr><td><svg><use fill="#ffe4e1" href="#color"/></svg>MistyRose
<td>#ffe4e1
<tr><td><svg><use fill="#dcdcdc" href="#color"/></svg>Gainsboro
<td>#dcdcdc
<tr><td><svg><use fill="#d3d3d3" href="#color"/></svg>LightGray
<td>#d3d3d3
<tr><td><svg><use fill="#d3d3d3" href="#color"/></svg>LightGrey
<td>#d3d3d3
<tr><td><svg><use fill="#c0c0c0" href="#color"/></svg>Silver
<td>#c0c0c0
<tr><td><svg><use fill="#a9a9a9" href="#color"/></svg>DarkGray
<td>#a9a9a9
<tr><td><svg><use fill="#a9a9a9" href="#color"/></svg>DarkGrey
<td>#a9a9a9
<tr><td><svg><use fill="#808080" href="#color"/></svg>Gray
<td>#808080
<tr><td><svg><use fill="#808080" href="#color"/></svg>Grey
<td>#808080
<tr><td><svg><use fill="#696969" href="#color"/></svg>DimGray
<td>#696969
<tr><td><svg><use fill="#696969" href="#color"/></svg>DimGrey
<td>#696969
<tr><td><svg><use fill="#778899" href="#color"/></svg>LightSlateGray
<td>#778899
<tr><td><svg><use fill="#778899" href="#color"/></svg>LightSlateGrey
<td>#778899
<tr><td><svg><use fill="#708090" href="#color"/></svg>SlateGray
<td>#708090
<tr><td><svg><use fill="#708090" href="#color"/></svg>SlateGrey
<td>#708090
<tr><td><svg><use fill="#2f4f4f" href="#color"/></svg>DarkSlateGray
<td>#2f4f4f
<tr><td><svg><use fill="#2f4f4f" href="#color"/></svg>DarkSlateGrey
<td>#2f4f4f
<tr><td><svg><use fill="#000000" href="#color"/></svg>Black
<td>#000000
</table>
'''
[Cubes]
category = 'Art'
preamble = '''
<p>
Draw <b>7</b> cubes in increasing size using "╱" (U+2571) for the diagonal
edges, "│" (U+2502) for the vertical edges, "─" (U+2500) for the
horizontal edges, and "█" (U+2588) for the vertices. The cubes should
range from size <b>1</b> to size <b>7</b> with a blank line between each
cube. A size <b>1</b> cube should look like:
<pre> █────█
╱ ╱│
█────█ │
│ │ █
│ │╱
█────█
</pre>
<p>And a size <b>7</b> cube should look like:
<pre> █────────────────────────────█
╱ ╱│
╱ ╱ │
╱ ╱ │
╱ ╱ │
╱ ╱ │
╱ ╱ │
╱ ╱ │
█────────────────────────────█ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ █
│ │ ╱
│ │ ╱
│ │ ╱
│ │ ╱
│ │ ╱
│ │ ╱
│ │╱
█────────────────────────────█
</pre>
'''
[Diamonds]
category = 'Art'
preamble = '''
<p>
Print a size ascending range of Diamonds using the numbers <b>1</b> to
<b>9</b>, ranging from size <b>1</b> to size <b>9</b>, each diamond
separated by a blank line.<p>A size <b>1</b> diamond should look like
this, a single centered <b>1</b>:
<pre> 1</pre>
<p>With the largest size <b>9</b> diamond looking like this:
<pre> 1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
123456787654321
1234567654321
12345654321
123454321
1234321
12321
121
1
</pre>
'''
[Divisors]
category = 'Sequence'
preamble = '''
<p>
A number is a divisor of another number if it can divide into it with no
remainder.
<p>
Print the positive divisors of each number from <b>1</b> to <b>100</b>
inclusive, on their own line, with each divisor separated by a space.
'''
['Emirp Numbers']
category = 'Sequence'
links = [
{ name = 'OEIS A006567', url = '//oeis.org/A006567' },
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Emirp_primes' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Emirp' },
]
preamble = '''
<p>
An emirp (prime spelled backwards) is a prime number that results in a
different prime when its decimal digits are reversed. For example both
<b>13</b> and <b>31</b> are emirps.
<p>
Print all the emirp numbers from <b>1</b> to <b>1000</b> inclusive, each
on their own line.
'''
['Ellipse Perimeters']
category = 'Mathematics'
links = [
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Ellipse' },
]
experiment = -1
preamble = '''
<p>
Given the two radii of an ellipse, compute its perimeter and print
its integer part.
'''
[Emojify]
category = 'Transform'
links = [
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/List_of_emoticons' },
]
preamble = '''
<p>
Given each of the following ASCII emoticons print the corresponding
Unicode emoji.
<p>Note despite how they appear below, there are no spaces in the emoticons.
<div id=emojify>
<div>😀<pre> :-D</pre></div>
<div>🙂<pre> :-)</pre></div>
<div>😐<pre> :-|</pre></div>
<div>🙁<pre> :-(</pre></div>
<div>😕<pre> :-\</pre></div>
<div>😗<pre> :-*</pre></div>
<div>😮<pre> :-O</pre></div>
<div>🤐<pre> :-#</pre></div>
<div>😅<pre>':-D</pre></div>
<div>😓<pre>':-(</pre></div>
<div>😂<pre>:'-)</pre></div>
<div>😢<pre>:'-(</pre></div>
<div>😛<pre> :-P</pre></div>
<div>😜<pre> ;-P</pre></div>
<div>😝<pre> X-P</pre></div>
<div>😆<pre> X-)</pre></div>
<div>😇<pre>O:-)</pre></div>
<div>😉<pre> ;-)</pre></div>
<div>😳<pre> :-$</pre></div>
<div>😶<pre> :- </pre></div>
<div>😎<pre> B-)</pre></div>
<div>😏<pre> :-J</pre></div>
<div>😈<pre>}:-)</pre></div>
<div>👿<pre>}:-(</pre></div>
<div>😡<pre> :-@</pre></div>
</div>
'''
['Evil Numbers']
category = 'Sequence'
links = [
{ name = 'OEIS A001969', url = '//oeis.org/A001969' },
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Population_count' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Evil_number' },
]
preamble = '''
<p>
An evil number is a non-negative number that has an even number of 1s in
its binary expansion.
<p>
Print all the evil numbers from <b>0</b> to <b>50</b> inclusive, each on
their own line.
<p>
Numbers that are not evil are called
<a href=odious-numbers>odious numbers</a>.
'''
[Fibonacci]
category = 'Sequence'
links = [
{ name = 'OEIS A000045', url = '//oeis.org/A000045' },
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Fibonacci_sequence' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Fibonacci_number' },
]
preamble = '''
<p>
Print the first <b>31</b> Fibonacci numbers from <b>F<sub>0</sub> = 0</b>
to <b>F<sub>30</sub> = 832040</b> (inclusive), each on a separate line.
'''
['Fizz Buzz']
category = 'Sequence'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/FizzBuzz' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Fizz_buzz' },
]
preamble = '''
<p>
Print the numbers from <b>1</b> to <b>100</b> inclusive, each on their own
line.
<p>
If, however, the number is a multiple of <b>three</b> then print
<b>Fizz</b> instead, and if the number is a multiple of <b>five</b> then
print <b>Buzz</b>.
<p>
For numbers which are multiples of <b>both three and five</b> then print
<b>FizzBuzz</b>.
'''
['Happy Numbers']
category = 'Sequence'
links = [
{ name = 'OEIS A007770', url = '//oeis.org/A007770' },
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Happy_numbers' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Happy_number' },
]
preamble = '''
<p>
A happy number is defined by the following Sequence: Starting with any
positive integer, replace the number by the sum of the squares of its
digits in base-ten, and repeat the process until the number either equals
1 (where it will stay), or it loops endlessly in a cycle that does not
include 1. Those numbers for which this process ends in 1 are happy
numbers, while those that do not end in 1 are sad numbers.
<p>For example, 19 is happy, as the associated Sequence is:</p>
<dl>
<dd>1<sup>2</sup> + 9<sup>2</sup> = 82
<dd>8<sup>2</sup> + 2<sup>2</sup> = 68
<dd>6<sup>2</sup> + 8<sup>2</sup> = 100
<dd>1<sup>2</sup> + 0<sup>2</sup> + 0<sup>2</sup> = 1.
</dl>
<p>
Print all the happy numbers from <b>1</b> to <b>200</b> inclusive, each on
their own line.
'''
[Intersection]
category = 'Mathematics'
links = [
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Intersection' },
]
preamble = '''
<p>A box is defined via <b>x</b>, <b>y</b>, <b>w</b> and <b>h</b> as
<pre>
y
│ ┌───w───┐
│ │ ┌───┼──┐
│ h │▓▓▓│ │
│ │ │▓▓▓│ │
│ o───┼───┘ │
│ o──────┘
└───────────────x
(0,0)
</pre>
<p>Compute the intersection area between two boxes given as
<pre>x1 y1 w1 h1 x2 y2 w2 h2</pre>
'''
['Julia Set']
category = 'Art'
experiment = -1
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Julia_set' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Julia_set' },
]
preamble = '''
<p>
In a 500x500px canvas, draw the Julia for f(z) = z^2 + c, where c = -0.4 + 0.6i. Output the image in ppm grayscale format.
'''
['Kolakoski Constant']
category = 'Mathematics'
links = [
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Kolakoski_sequence#Kolakoski_Constant' },
]
preamble = '''
<p>
The Kolakoski constant is created by taking the
<a href=kolakoski-sequence>Kolakoski sequence</a> and subtracting one from
each element then interpreting it as a binary fraction.
<pre>
1 221121221221121122121121…
0.110010110110010011010010…
0.7945071927…
</pre>
<p>Print the Kolakoski constant to the first 1,000 decimal places.
'''
['Kolakoski Sequence']
category = 'Sequence'
links = [
{ name = 'OEIS A000002', url = '//oeis.org/A000002' },
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Kolakoski_sequence' },
]
preamble = '''
<p>
The Kolakoski sequence is a self referential sequence where the nth
element is the length of the nth run of same numbers in the sequence.
This has the interesting property where if you take the run lengths of
this sequence, then you will get the same sequence back again. For
example, the sequence starting with (1, 2) looks like:
<pre>
1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 1…
1 2 2 1 1 2 1 2 2 1 2 2 1 1 2 1 1…
</pre>
<p>
Beginning with (1, 2) output the first 1000 elements in the Kolakoski
sequence, separated by spaces.
'''
['Leap Years']
category = 'Sequence'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Leap_year' },
]
preamble = '''
<p>
In the Gregorian calendar, a leap year is created by extending February
to 29 days in order to keep the calendar year synchronized with the
astronomical year. These longer years occur in years which are multiples
of <b>4</b>, with the exception of centennial years that aren’t multiples
of <b>400</b>.
<p>
Write a program to print all the leap years from the year <b>1800</b> up
to and including <b>2400</b>.
'''
['Levenshtein Distance']
category = 'Transform'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Levenshtein_distance' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Levenshtein_distance' },
]
preamble = '''
<p>
The Levenshtein distance is the minimum number of single character edits
that are needed to transform one word into another. The available edits
are deletion, insertion, or substitution of a single character.
<p>
For example the Levenshtein distance between <b>“shine”</b> and
<b>“train”</b> is 4:
<ol>
<li>shine → shin (deletion of 'e')
<li>shin → <b>t</b>shin (insertion of 't')
<li>t<b>s</b>hin → t<b>r</b>hin (substitution of 's' for 'r')
<li>tr<b>h</b>in → tr<b>a</b>in (substitution of 'h' for 'a')
</ol>
<p>
For each pair of words per argument, print the Levenshtein distance on its
own line.
'''
['Leyland Numbers']
category = 'Sequence'
links = [
{ name = 'OEIS A076980', url = '//oeis.org/A076980' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Leyland_number' },
]
preamble = '''
<p>
A leyland number is of the form <b>x<sup>y</sup> + y<sup>x</sup></b> where
<b>1 < y ≤ x</b>.
<p>
For example, <b>8</b> is a leyland number because
<b>2<sup>2</sup> + 2<sup>2</sup> = 8</b>.
<p>
Print all the leyland numbers from <b>1</b> to <b>100,000,000,000</b>
inclusive, each on their own line.
'''
['Look and Say']
category = 'Sequence'
links = [
{ name = 'OEIS A005150', url = '//oeis.org/A005150' },
{ name = 'Rosetta Code', url = '//www.rosettacode.org/wiki/Look-and-say_sequence' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Look-and-say_sequence' },
]
preamble = '''
<p>
The Look and Say sequence starts with 1 and is continued by looking
at each of the runs of the same number in the previous element and combining
the length with the original number. For example the next element after
111221 would be 312211 (three ones, two twos and one one).
<p>Print the first 20 elements of the Look and Say sequence.
'''
['Lucky Tickets']
category = 'Mathematics'
preamble = '''
<p>
In Russia, bus ticket numbers consist of 6 decimal digits. It is considered lucky when the sum of the first three digits equals the sum of the last three digits. The concept of lucky tickets can be extended to ticket numbering systems with even numbers of digits and arbitrary bases.
<p>
Each argument describes a ticket numbering system and consists of two numbers separated by a space. The first is the even number of digits. The second is the base of the numbering system (2-16). For each argument, output the total number of lucky tickets for the numbering system on a separate line.
'''
[Mandelbrot]
category = 'Art'
experiment = -1
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Mandelbrot_set' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Mandelbrot_set' },
]
preamble = '''
<p>
Draw the Mandelbrot set in a 40x80 Unicode grid by using ▒ (U+2592)
and █ (U+2588).
'''
[Maze]
category = 'Gaming'
experiment = 338
links = [
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Maze_solving_algorithm' },
]
preamble = '''
<p>
For each input maze, find the shortest path from <b>S</b>tart to <b>E</b>nd points. Output the path in the maze with dots. For example:
<pre>
███████████ ███████████
█S█ E█ █S█ ....E█
█ ███ █████ █.███.█████
█ █ █ → █...█.....█
███ █████ █ ███.█████.█
█ █ █ .......█
███████████ ███████████
</pre>
'''
['Morse Decoder']
category = 'Transform'
links = [
{ name = 'Rosetta Code', url = '//rosettacode.org/wiki/Morse_code' },
{ name = 'Wikipedia', url = '//www.wikipedia.org/wiki/Morse_code' },
]
preamble = '''
<p>
Using ▄ (U+2584 Lower Half Block) to represent a dot, decode the argument
from International Morse Code to alphanumeric.
<ol>
<li>The length of a dot is one unit.
<li>A dash is three units.
<li>The space between parts of the same letter is one unit.
<li>The space between letters is three units.
<li>The space between words is ten units.
</ol>