Introduction:
Since it's almost Halloween, I was just thinking of some random Halloween-themed challenges. Eventually I was reading through Frankenstein's wikipedia page, and came across the following text:
The creature
Part of Frankenstein's rejection of his creation is the fact that he does not give it a name, which causes a lack of identity. Instead it is referred to by words such as "wretch", "monster", "creature", "demon", "devil", "fiend", and "it". When Frankenstein converses with the creature in Chapter 10, he addresses it as "vile insect", "abhorred monster", "fiend", "wretched devil", and "abhorred devil".
Challenge:
Given two integers (year and chapter), output a string based on the following rules:
- If the year is less than 1818: output an empty string †
- If the year is exactly 1818 and the chapter is below 10: output a random string from the list
["wretch", "monster", "creature", "demon", "devil", "fiend", "it"]
- If the year is exactly 1818 and the chapter is 10 or higher: output a random string from the list
["vile insect", "abhorred monster", "fiend", "wretched devil", "abhorred devil"]
- Is the year above 1818 (and thus the book was published), return
"Frankenstein's Monster"
.
Challenge rules:
- You can choose whether to output in lowercase, uppercase, or a combination.
- The year will always be in the range
1500-2017
- The chapter will always be in the range
1-24
(if I googled correctly, the book has 24 chapters) - † Instead of outputting an empty string for option 1, you are also allowed to output
null
,undefined
,false
,0
, or any other value of your choice not part of the other three options (please specify what you've used in your answer). - The output may not contain any leading or trailing spaces/tabs, nor any leading new-lines. It may contain one optional trailing new-line.
General rules:
- This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language. - Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
- Default Loopholes are forbidden (especially 'Fake random numbers').
- If possible, please add a link with a test for your code.
- Also, please add an explanation if necessary.
Test cases:
year,chapter possible outputs:
1700,1 ""; null; undefined; false; 0; etc.
1700,12 ""; null; undefined; false; 0; etc.
1817,10 ""; null; undefined; false; 0; etc.
1818,1 "wretch"; "monster"; "creature"; "demon"; "devil"; "fiend"; "it"
1818,9 "wretch"; "monster"; "creature"; "demon"; "devil"; "fiend"; "it"
1818,10 "vile insect"; "abhorred monster"; "fiend"; "wretched devil"; "abhorred devil"
1818,11 "vile insect"; "abhorred monster"; "fiend"; "wretched devil"; "abhorred devil"
1818,18 "vile insect"; "abhorred monster"; "fiend"; "wretched devil"; "abhorred devil"
1819,1 "Frankenstein's Monster"; "frankenstein's monster"; "FRANKENSTEIN'S MONSTER"
1819,18 "Frankenstein's Monster"; "frankenstein's monster"; "FRANKENSTEIN'S MONSTER"
2017,24 "Frankenstein's Monster"; "frankenstein's monster"; "FRANKENSTEIN'S MONSTER"