Skip to content

Commit 834750b

Browse files
committed
Add the "diamonds" hole
Updates #3
1 parent 24bad04 commit 834750b

File tree

5 files changed

+125
-14
lines changed

5 files changed

+125
-14
lines changed

categories.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
12 Days of Christmas
44
99 Bottles of Beer
55
Christmas Trees
6-
Diamonds *todo*
6+
Diamonds
77
Sierpiński Triangle
88
Swallowed a Fly *todo*
99

@@ -32,6 +32,7 @@ Evil Numbers
3232
Fibonacci
3333
Fizz Buzz
3434
Happy Numbers
35+
Niven Numbers
3536
Odious Numbers
3637
Pascal's Triangle
3738
Pernicious Numbers

db.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ CREATE TYPE public.hole AS ENUM (
3838
'arabic-to-roman',
3939
'brainfuck',
4040
'christmas-trees',
41+
'diamonds',
4142
'divisors',
4243
'emirp-numbers',
4344
'evil-numbers',

routes/answers.go

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,95 @@ Go to the store and buy some more, 99 bottles of beer on the wall.`,
468468
***************
469469
*****************
470470
*`,
471+
"diamonds": ` 1
472+
473+
1
474+
121
475+
1
476+
477+
1
478+
121
479+
12321
480+
121
481+
1
482+
483+
1
484+
121
485+
12321
486+
1234321
487+
12321
488+
121
489+
1
490+
491+
1
492+
121
493+
12321
494+
1234321
495+
123454321
496+
1234321
497+
12321
498+
121
499+
1
500+
501+
1
502+
121
503+
12321
504+
1234321
505+
123454321
506+
12345654321
507+
123454321
508+
1234321
509+
12321
510+
121
511+
1
512+
513+
1
514+
121
515+
12321
516+
1234321
517+
123454321
518+
12345654321
519+
1234567654321
520+
12345654321
521+
123454321
522+
1234321
523+
12321
524+
121
525+
1
526+
527+
1
528+
121
529+
12321
530+
1234321
531+
123454321
532+
12345654321
533+
1234567654321
534+
123456787654321
535+
1234567654321
536+
12345654321
537+
123454321
538+
1234321
539+
12321
540+
121
541+
1
542+
543+
1
544+
121
545+
12321
546+
1234321
547+
123454321
548+
12345654321
549+
1234567654321
550+
123456787654321
551+
12345678987654321
552+
123456787654321
553+
1234567654321
554+
12345654321
555+
123454321
556+
1234321
557+
12321
558+
121
559+
1`,
471560
"divisors": `1
472561
1 2
473562
1 3

routes/home.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,20 @@ func home(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
112112
WHEN '12-days-of-christmas' THEN 12
113113
WHEN '99-bottles-of-beer' THEN 13
114114
WHEN 'christmas-trees' THEN 14
115-
WHEN 'morse-decoder' THEN 15
116-
WHEN 'morse-encoder' THEN 16
117-
WHEN 'pangram-grep' THEN 17
118-
WHEN 'seven-segment' THEN 18
119-
WHEN 'sierpiński-triangle' THEN 19
120-
WHEN 'π' THEN 20
121-
WHEN 'φ' THEN 21
122-
WHEN '𝑒' THEN 22
123-
WHEN 'τ' THEN 23
124-
WHEN 'arabic-to-roman' THEN 24
125-
WHEN 'brainfuck' THEN 25
126-
WHEN 'roman-to-arabic' THEN 26
127-
WHEN 'spelling-numbers' THEN 27
115+
WHEN 'diamonds' THEN 15
116+
WHEN 'morse-decoder' THEN 16
117+
WHEN 'morse-encoder' THEN 17
118+
WHEN 'pangram-grep' THEN 18
119+
WHEN 'seven-segment' THEN 19
120+
WHEN 'sierpiński-triangle' THEN 20
121+
WHEN 'π' THEN 21
122+
WHEN 'φ' THEN 22
123+
WHEN '𝑒' THEN 23
124+
WHEN 'τ' THEN 24
125+
WHEN 'arabic-to-roman' THEN 25
126+
WHEN 'brainfuck' THEN 26
127+
WHEN 'roman-to-arabic' THEN 27
128+
WHEN 'spelling-numbers' THEN 28
128129
END, row_number`,
129130
userID,
130131
)

routes/types.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ A Partridge in a Pear Tree.</blockquote>`,
6565
***************
6666
*****************
6767
*</pre>`,
68+
}, {
69+
"diamonds", "Diamonds", "Medium",
70+
`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
71+
121
72+
12321
73+
1234321
74+
123454321
75+
12345654321
76+
1234567654321
77+
123456787654321
78+
12345678987654321
79+
123456787654321
80+
1234567654321
81+
12345654321
82+
123454321
83+
1234321
84+
12321
85+
121
86+
1</pre>`,
6887
}, {
6988
"divisors", "Divisors", "Fast",
7089
"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.</p>",

0 commit comments

Comments
 (0)