Skip to content

Commit aa9e81e

Browse files
committed
Add the "emirp-numbers" hole
Updates #3
1 parent ac9b179 commit aa9e81e

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

answers.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,35 @@ Take one down and pass it around, no more bottles of beer on the wall.
300300
301301
No more bottles of beer on the wall, no more bottles of beer.
302302
Go to the store and buy some more, 99 bottles of beer on the wall.`,
303+
"emirp-numbers": `13
304+
17
305+
31
306+
37
307+
71
308+
73
309+
79
310+
97
311+
101
312+
107
313+
113
314+
131
315+
149
316+
151
317+
157
318+
167
319+
179
320+
181
321+
191
322+
199
323+
311
324+
313
325+
337
326+
347
327+
353
328+
359
329+
373
330+
383
331+
389`,
303332
"fibonacci": `0
304333
1
305334
1

code-golf.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ func codeGolf(w http.ResponseWriter, r *http.Request) {
246246
case "99-bottles-of-beer",
247247
"arabic-to-roman-numerals",
248248
"e",
249+
"emirp-numbers",
249250
"fibonacci",
250251
"fizz-buzz",
251252
"pascals-triangle",

db.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ func printScores(w io.WriteCloser, hole, lang string, userID int) {
180180
{"99-bottles-of-beer", "99 Bottles of Beer"},
181181
{"arabic-to-roman-numerals", "Arabic to Roman"},
182182
{"e", "e"},
183+
{"emirp-numbers", "Emirp Numbers"},
183184
{"fibonacci", "Fibonacci"},
184185
{"fizz-buzz", "Fizz Buzz"},
185186
{"pascals-triangle", "Pascal's Triangle"},

preambles.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
var intros = map[string]string{
44
"99-bottles-of-beer": `<div class="beg hole"><a href=99-bottles-of-beer>99 Bottles of Beer<p>99 bottles of beer on the wall, 99 bottles of beer…</p></a><table>`,
5+
"emirp-numbers": `<div class="beg hole"><a href=emirp-numbers>Emirp Numbers</a><table>`,
56
"fibonacci": `<div class="beg hole"><a href=fibonacci>Fibonacci<p>Each number is the sum of the two preceding numbers…</p></a><table>`,
67
"fizz-buzz": `<div class="beg hole"><a href=fizz-buzz>Fizz Buzz<p>Write a program that prints the numbers from 1 to 100…</p></a><table>`,
78
"prime-numbers": `<div class="beg hole"><a href=prime-numbers>Prime Numbers</a><table>`,
@@ -15,6 +16,7 @@ var intros = map[string]string{
1516

1617
var preambles = map[string]string{
1718
"99-bottles-of-beer": `<h1>99 Bottles of Beer</h1><p>Print the lyrics to the song 99 Bottles of Beer.</p>`,
19+
"emirp-numbers": `<h1>Emirp Numbers</h1><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><p>Print all the emirps between <b>1</b> and <b>500</b></p>`,
1820
"fibonacci": `<h1>Fibonacci</h1><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.</p>`,
1921
"fizz-buzz": `<h1>Fizz Buzz</h1><p>Print the numbers from <b>1</b> to <b>100</b> (inclusive), each on their own line.</p><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><p>For numbers which are multiples of <b>both three and five</b> then print <b>FizzBuzz</b>.</p>`,
2022
"prime-numbers": `<h1>Prime Numbers</h1><p>Print all the prime numbers between <b>1</b> and <b>100</b></p>`,

0 commit comments

Comments
 (0)