Weekly Code Puzzle: Find Your Villain Name

Welcome back Puzzlers. After long break over the holidays we have returned for more exciting puzzle fun.

The puzzle:


Create a function, getVillainName, that returns a villain name based on the user's birthday. (The birthday will be passed to the function as a valid Date object, so for simplicity, there's no need to worry about converting strings to dates.)

The first name will come from the month, and the last name will come from the last digit of the date.

Month ➝ first name

January ➝ "The Evil"
February ➝ "The Vile"
March ➝ "The Cruel"
April ➝ "The Trashy"
May ➝ "The Despicable"
June ➝ "The Embarrassing"
July ➝ "The Disreputable"
August ➝ "The Atrocious"
September ➝ "The Twirling"
October ➝ "The Orange"
November ➝ "The Terrifying"
December ➝ "The Awkward"

Last digit of date ➝ last name

0 ➝ "Mustache"
1 ➝ "Pickle"
2 ➝ "Hood Ornament"
3 ➝ "Raisin"
4 ➝ "Recycling Bin"
5 ➝ "Potato"
6 ➝ "Tomato"
7 ➝ "House Cat"
8 ➝ "Teaspoon"
9 ➝ "Laundry Basket"

The returned value should be a string in the form of "First Name Last Name".

For example, a birthday of November 18 would return "The Terrifying Teaspoon"

This puzzle is a 7KYU on CodeWars, meaning it's the second easiest difficulty level. If you find it too easy then keep in mind that this puzzle master looks kindly on inventive/unconventional solutions or the usage of obscure language features.

Also this puzzle is only available in Javascript, don't let that scare you though if you are more familiar with other languages. It's good to practice what you know in multiple languages.


Complete the puzzle on CodeWars and then follow these instructions to get the link to your solution and email that link to weeklypuzzle@bloc.io or tweet it at @trybloc. Submit by Friday January 22nd 9am PST to be included.