Skip to content

Commit 05e21ff

Browse files
committed
Add the "brainfuck" hole
Updates #3
1 parent 5cb8b88 commit 05e21ff

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

routes/hole.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Two Turtle Doves, and
3030
A Partridge in a Pear Tree.</blockquote>`,
3131
"99-bottles-of-beer": `<h1>99 Bottles of Beer</h1><p>Print the lyrics to the song 99 Bottles of Beer.</p>`,
3232
"arabic-to-roman": `<h1>Arabic to Roman</h1><p>For each arabic numeral argument print the same number in roman numerals.</p>`,
33+
"brainfuck": `<h1>Brainfuck</h1><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:<table><tr><th>&gt;<td>ptr++<tr><th>&lt;<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><p>Write a program that will receive various Brainfuck programs as arguments and execute each program in turn.</p>`,
3334
"christmas-trees": `<h1>Christmas Trees</h1><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> *
3435
***
3536
*****

routes/home.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ func home(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
7474
WHEN '𝑒' THEN 19
7575
WHEN 'τ' THEN 20
7676
WHEN 'arabic-to-roman' THEN 21
77-
WHEN 'roman-to-arabic' THEN 22
78-
WHEN 'spelling-numbers' THEN 23
77+
WHEN 'brainfuck' THEN 22
78+
WHEN 'roman-to-arabic' THEN 23
79+
WHEN 'spelling-numbers' THEN 24
7980
END, row_number`,
8081
printHeader(w, r, 200),
8182
)
@@ -137,6 +138,8 @@ func home(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
137138
w.Write([]byte(`Medium><a href=99-bottles-of-beer>99 Bottles of Beer`))
138139
case "arabic-to-roman":
139140
w.Write([]byte(`Slow><a href=arabic-to-roman>Arabic to Roman`))
141+
case "brainfuck":
142+
w.Write([]byte(`Slow><a href=brainfuck>Brainfuck`))
140143
case "christmas-trees":
141144
w.Write([]byte(`Medium><a href=christmas-trees>Christmas Trees`))
142145
case "divisors":

routes/scores.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var holes = [][]string{
1414
{"12-days-of-christmas", "12 Days of Christmas"},
1515
{"99-bottles-of-beer", "99 Bottles of Beer"},
1616
{"arabic-to-roman", "Arabic to Roman"},
17+
{"brainfuck", "Brainfuck"},
1718
{"christmas-trees", "Christmas Trees"},
1819
{"divisors", "Divisors"},
1920
{"emirp-numbers", "Emirp Numbers"},

routes/solution.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ func solution(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
4141
switch in.Hole {
4242
case "arabic-to-roman":
4343
args, out.Exp = arabicToRoman(false)
44+
case "brainfuck":
45+
args, out.Exp = brainfuck()
4446
case "pangram-grep":
4547
args, out.Exp = pangramGrep()
4648
case "quine":

0 commit comments

Comments
 (0)