Pyke, 29 bytes
EF 73 77 59 25 54 25 75 09 60 84 58 22 23 61 82 73 82 72 00 24 52 40 7E 5F 39 39 73 EF
Try it here!, Ungolfed with full tests
.o - map(ord, input)
s - sum(^)
wY%T% - (^ % 57) % 10 // wY is 57
R@ - v[^]
u\t`\x84X"#a\x82s\x82r\x00$ - [96, 600, 34, 35, 97, 371, 370, 0, 36]
~_99s - ^ + 333333 + 99
.o - dictionary_lookup(^)
We start off by converting the input to a list of integers corresponding to the ascii characters and then summing them. This produces the following set of numbers for ["Water", "Electric", "Fire", "Psychic", "Dark", "Grass", "Ice", "Fairy"]
: [515, 811, 390, 723, 386, 512, 273, 507]
. We then perform a magic operation ((x % 57) % 10
) to get the following list of offsets: [2, 3, 8, 9, 4, 6, 5, 1]
.
The bytes below correspond to the following compressed list: [96, 600, 34, 35, 97, 371, 370, 0, 36]
, and we index into it based on the offsets we had previously. There's a 0 in there due to my inability to get it not to wrap.
75 09 60 84 58 22 23 61 82 73 82 72 00 24
Try it here!
This list of numbers corresponds to the location in the Pokedex, minus 100. Pyke's dictionary handily contains the Pokedex starting from index 333333 (0 indexed). It also comes with a convenient default variable, ~_
, for getting that particular number. We then add 99 to it to take an offset to Pyke's dictionary, and then use .o
to look up that particular word.