Background
The computer game NetHack dates from 1987, before the use of graphics in computer games was widely established. There are lots of monsters in the game, and potentially a lot need to fit on screen at once, so monsters are drawn in a very minimal way: a monster is simply drawn as an ASCII character on screen.
In addition to there being lots of monsters, there are lots of types of monster. It can be important to know which is which; you'd have to react differently upon seeing a kitten and seeing a dragon. As such, most of ASCII is used to represent monsters; for example, a kitten is f
, and a red dragon is D
. This means that it can be very helpful to know what a given monster will look like, as it will help you to recognise it if you encounter it later on in the game. (Note that there are more types of monsters than there are ASCII characters, so some of them share; a red dragon and a blue dragon are both D
.)
Task
Your program must take the name of a NetHack monster as input, and produce the ASCII character that represents it within the game as output. The program is allowed to assume that the input is in fact the name of a NetHack monster; it may if it wishes crash, produce meaningless results, etc. if the input is invalid.
The following Stack Snippet is a JSON object giving the full mapping of possible inputs to their corresponding outputs:
{
"Aleax": "A",
"Angel": "A",
"Arch Priest": "@",
"Archon": "A",
"Ashikaga Takauji": "@",
"Asmodeus": "&",
"Baalzebub": "&",
"Chromatic Dragon": "D",
"Croesus": "@",
"Cyclops": "H",
"Dark One": "@",
"Death": "&",
"Demogorgon": "&",
"Dispater": "&",
"Elvenking": "@",
"Famine": "&",
"Geryon": "&",
"Grand Master": "@",
"Green-elf": "@",
"Grey-elf": "@",
"Hippocrates": "@",
"Ixoth": "D",
"Juiblex": "&",
"Keystone Kop": "K",
"King Arthur": "@",
"Kop Kaptain": "K",
"Kop Lieutenant": "K",
"Kop Sergeant": "K",
"Lord Carnarvon": "@",
"Lord Sato": "@",
"Lord Surtur": "H",
"Master Assassin": "@",
"Master Kaen": "@",
"Master of Thieves": "@",
"Medusa": "@",
"Minion of Huhetotl": "&",
"Mordor orc": "o",
"Nalzok": "&",
"Nazgul": "W",
"Neferet the Green": "@",
"Norn": "@",
"Olog-hai": "T",
"Oracle": "@",
"Orcus": "&",
"Orion": "@",
"Pelias": "@",
"Pestilence": "&",
"Scorpius": "s",
"Shaman Karnov": "@",
"Thoth Amon": "@",
"Twoflower": "@",
"Uruk-hai": "o",
"Vlad the Impaler": "V",
"Wizard of Yendor": "@",
"Woodland-elf": "@",
"Yeenoghu": "&",
"abbot": "@",
"acid blob": "b",
"acolyte": "@",
"air elemental": "E",
"aligned priest": "@",
"ape": "Y",
"apprentice": "@",
"arch-lich": "L",
"archeologist": "@",
"attendant": "@",
"baby black dragon": "D",
"baby blue dragon": "D",
"baby crocodile": ":",
"baby gray dragon": "D",
"baby green dragon": "D",
"baby long worm": "w",
"baby orange dragon": "D",
"baby purple worm": "w",
"baby red dragon": "D",
"baby silver dragon": "D",
"baby white dragon": "D",
"baby yellow dragon": "D",
"balrog": "&",
"baluchitherium": "q",
"barbarian": "@",
"barbed devil": "&",
"barrow wight": "W",
"bat": "B",
"black dragon": "D",
"black light": "y",
"black naga hatchling": "N",
"black naga": "N",
"black pudding": "P",
"black unicorn": "u",
"blue dragon": "D",
"blue jelly": "j",
"bone devil": "&",
"brown mold": "F",
"brown pudding": "P",
"bugbear": "h",
"captain": "@",
"carnivorous ape": "Y",
"cave spider": "s",
"caveman": "@",
"cavewoman": "@",
"centipede": "s",
"chameleon": ":",
"chickatrice": "c",
"chieftain": "@",
"clay golem": "'",
"cobra": "S",
"cockatrice": "c",
"couatl": "A",
"coyote": "d",
"crocodile": ":",
"demilich": "L",
"dingo": "d",
"disenchanter": "R",
"djinni": "&",
"dog": "d",
"doppelganger": "@",
"dust vortex": "v",
"dwarf king": "h",
"dwarf lord": "h",
"dwarf mummy": "M",
"dwarf zombie": "Z",
"dwarf": "h",
"earth elemental": "E",
"electric eel": ";",
"elf mummy": "M",
"elf zombie": "Z",
"elf": "@",
"elf-lord": "@",
"energy vortex": "v",
"erinys": "&",
"ettin mummy": "M",
"ettin zombie": "Z",
"ettin": "H",
"fire ant": "a",
"fire elemental": "E",
"fire giant": "H",
"fire vortex": "v",
"flaming sphere": "e",
"flesh golem": "'",
"floating eye": "e",
"fog cloud": "v",
"forest centaur": "C",
"fox": "d",
"freezing sphere": "e",
"frost giant": "H",
"gargoyle": "g",
"garter snake": "S",
"gas spore": "e",
"gecko": ":",
"gelatinous cube": "b",
"ghost": " ",
"ghoul": "Z",
"giant ant": "a",
"giant bat": "B",
"giant beetle": "a",
"giant eel": ";",
"giant mimic": "m",
"giant mummy": "M",
"giant rat": "r",
"giant spider": "s",
"giant zombie": "Z",
"giant": "H",
"glass golem": "'",
"glass piercer": "p",
"gnome king": "G",
"gnome lord": "G",
"gnome mummy": "M",
"gnome zombie": "Z",
"gnome": "G",
"gnomish wizard": "G",
"goblin": "o",
"gold golem": "'",
"golden naga hatchling": "N",
"golden naga": "N",
"gray dragon": "D",
"gray ooze": "P",
"gray unicorn": "u",
"green dragon": "D",
"green mold": "F",
"green slime": "P",
"gremlin": "g",
"grid bug": "x",
"guard": "@",
"guardian naga hatchling": "N",
"guardian naga": "N",
"guide": "@",
"healer": "@",
"hell hound pup": "d",
"hell hound": "d",
"hezrou": "&",
"high priest": "@",
"hill giant": "H",
"hill orc": "o",
"hobbit": "h",
"hobgoblin": "o",
"homunculus": "i",
"horned devil": "&",
"horse": "u",
"housecat": "f",
"human mummy": "M",
"human zombie": "Z",
"human": "@",
"hunter": "@",
"ice devil": "&",
"ice troll": "T",
"ice vortex": "v",
"iguana": ":",
"imp": "i",
"incubus": "&",
"iron golem": "'",
"iron piercer": "p",
"jabberwock": "J",
"jackal": "d",
"jaguar": "f",
"jellyfish": ";",
"ki-rin": "A",
"killer bee": "a",
"kitten": "f",
"knight": "@",
"kobold lord": "k",
"kobold mummy": "M",
"kobold shaman": "k",
"kobold zombie": "Z",
"kobold": "k",
"kraken": ";",
"large cat": "f",
"large dog": "d",
"large kobold": "k",
"large mimic": "m",
"leather golem": "'",
"lemure": "i",
"leocrotta": "q",
"leprechaun": "l",
"lich": "L",
"lichen": "F",
"lieutenant": "@",
"little dog": "d",
"lizard": ":",
"long worm": "w",
"lurker above": "t",
"lynx": "f",
"mail daemon": "&",
"manes": "i",
"marilith": "&",
"master lich": "L",
"master mind flayer": "h",
"mastodon": "q",
"mind flayer": "h",
"minotaur": "H",
"monk": "@",
"monkey": "Y",
"mountain centaur": "C",
"mountain nymph": "n",
"mumak": "q",
"nalfeshnee": "&",
"neanderthal": "@",
"newt": ":",
"ninja": "@",
"nurse": "@",
"ochre jelly": "j",
"ogre king": "O",
"ogre lord": "O",
"ogre": "O",
"orange dragon": "D",
"orc mummy": "M",
"orc shaman": "o",
"orc zombie": "Z",
"orc": "o",
"orc-captain": "o",
"owlbear": "Y",
"page": "@",
"panther": "f",
"paper golem": "'",
"piranha": ";",
"pit fiend": "&",
"pit viper": "S",
"plains centaur": "C",
"pony": "u",
"priest": "@",
"priestess": "@",
"prisoner": "@",
"purple worm": "w",
"pyrolisk": "c",
"python": "S",
"quantum mechanic": "Q",
"quasit": "i",
"queen bee": "a",
"quivering blob": "b",
"rabid rat": "r",
"ranger": "@",
"raven": "B",
"red dragon": "D",
"red mold": "F",
"red naga hatchling": "N",
"red naga": "N",
"rock mole": "r",
"rock piercer": "p",
"rock troll": "T",
"rogue": "@",
"rope golem": "'",
"roshi": "@",
"rothe": "q",
"rust monster": "R",
"salamander": ":",
"samurai": "@",
"sandestin": "&",
"sasquatch": "Y",
"scorpion": "s",
"sergeant": "@",
"sewer rat": "r",
"shade": " ",
"shark": ";",
"shocking sphere": "e",
"shopkeeper": "@",
"shrieker": "F",
"silver dragon": "D",
"skeleton": "Z",
"small mimic": "m",
"snake": "S",
"soldier ant": "a",
"soldier": "@",
"spotted jelly": "j",
"stalker": "E",
"steam vortex": "v",
"stone giant": "H",
"stone golem": "'",
"storm giant": "H",
"straw golem": "'",
"student": "@",
"succubus": "&",
"tengu": "i",
"thug": "@",
"tiger": "f",
"titan": "H",
"titanothere": "q",
"tourist": "@",
"trapper": "t",
"troll": "T",
"umber hulk": "U",
"valkyrie": "@",
"vampire bat": "B",
"vampire lord": "V",
"vampire": "V",
"violet fungus": "F",
"vrock": "&",
"warg": "d",
"warhorse": "u",
"warrior": "@",
"watch captain": "@",
"watchman": "@",
"water demon": "&",
"water elemental": "E",
"water moccasin": "S",
"water nymph": "n",
"water troll": "T",
"werejackal": "d",
"wererat": "r",
"werewolf": "d",
"white dragon": "D",
"white unicorn": "u",
"winged gargoyle": "g",
"winter wolf cub": "d",
"winter wolf": "d",
"wizard": "@",
"wolf": "d",
"wood golem": "'",
"wood nymph": "n",
"woodchuck": "r",
"wraith": "W",
"wumpus": "q",
"xan": "x",
"xorn": "X",
"yellow dragon": "D",
"yellow light": "y",
"yellow mold": "F",
"yeti": "Y",
"zruty": "z"
}
So basically, the task here is "given a key in the dictionary represented by the JSON object above, return the corresponding value".
Note that this challenge is, in a way, a reverse kolmogorov-complexity; instead of going from a small/empty input to a large output, you're going from a large input to a small output. (There's thus lots of redundant information in the input, which you can ignore or make use of as you wish). It's also fairly similar to regex golf, except that a) any language is allowed (not just regex), and b) there are more than two possible outputs. (We've had a few tasks like this before, such as these two, but this task is somewhat different because the specified input/output behaviour has stronger patterns).
Clarifications
You can use any reasonable input and output format (e.g. you can produce the output as a character, or as its ASCII code, or as a string that's one character long). You can submit a function instead of a full program, if you prefer.
This is already mentioned in the standard loopholes, but just to reiterate: you cannot store the correspondence between input and output anywhere other than your program's source code. This challenge is basically about representing the input/output behaviour in the smallest space possible, so you must not do things like downloading a list from the Internet, store the correspondence in an external file, start NetHack in debug mode and spawn the monster in question to see what it looks like, etc.. (Besides, I don't want to have to fight off monsters to test your submissions.)
Victory condition
This is code-golf, so the winning entry will be the entry that is shortest, counted in bytes. Good luck!
mail daemon
>_< \$\endgroup\$