I'm always forgetting Pokemon type matchups. This is a challenge to print the pokemon type chart!
Attacking Type
No Fi Fl Po Gr Ro Bu Gh St Fr Wa Gr El Ps Ic Dr Da Fa
Normal 1.0 2.0 1.0 1.0 1.0 1.0 1.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Fighting 1.0 1.0 2.0 1.0 1.0 0.5 0.5 1.0 1.0 1.0 1.0 1.0 1.0 2.0 1.0 1.0 0.5 2.0
D Flying 1.0 0.5 1.0 1.0 0.0 2.0 0.5 1.0 1.0 1.0 1.0 0.5 2.0 1.0 2.0 1.0 1.0 1.0
e Poison 1.0 0.5 1.0 0.5 2.0 1.0 0.5 1.0 1.0 1.0 1.0 0.5 1.0 2.0 1.0 1.0 1.0 0.5
f Ground 1.0 1.0 1.0 0.5 1.0 0.5 1.0 1.0 1.0 1.0 2.0 2.0 0.0 1.0 2.0 1.0 1.0 1.0
e Rock 0.5 2.0 0.5 0.5 2.0 1.0 1.0 1.0 2.0 0.5 2.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0
n Bug 1.0 0.5 2.0 1.0 0.5 2.0 1.0 1.0 1.0 2.0 1.0 0.5 1.0 1.0 1.0 1.0 1.0 1.0
d Ghost 0.0 0.0 1.0 0.5 1.0 1.0 0.5 2.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 2.0 1.0
i Steel 0.5 2.0 0.5 0.0 2.0 0.5 0.5 1.0 0.5 2.0 1.0 0.5 1.0 0.5 0.5 0.5 1.0 0.5
n Fire 1.0 1.0 1.0 1.0 2.0 2.0 0.5 1.0 0.5 0.5 2.0 0.5 1.0 1.0 0.5 1.0 1.0 0.5
g Water 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.5 0.5 0.5 2.0 2.0 1.0 0.5 1.0 1.0 1.0
Grass 1.0 1.0 2.0 2.0 0.5 1.0 2.0 1.0 1.0 2.0 0.5 0.5 0.5 1.0 2.0 1.0 1.0 1.0
T Electric 1.0 1.0 0.5 1.0 2.0 1.0 1.0 1.0 0.5 1.0 1.0 1.0 0.5 1.0 1.0 1.0 1.0 1.0
y Psychic 1.0 0.5 1.0 1.0 1.0 1.0 2.0 2.0 1.0 1.0 1.0 1.0 1.0 0.5 1.0 1.0 2.0 1.0
p Ice 1.0 2.0 1.0 1.0 1.0 2.0 1.0 1.0 2.0 2.0 1.0 1.0 1.0 1.0 0.5 1.0 1.0 1.0
e Dragon 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.5 0.5 0.5 0.5 1.0 2.0 2.0 1.0 2.0
Dark 1.0 2.0 1.0 1.0 1.0 1.0 2.0 0.5 1.0 1.0 1.0 1.0 1.0 0.0 1.0 1.0 0.5 2.0
Fairy 1.0 0.5 1.0 2.0 1.0 1.0 0.5 1.0 2.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.5 1.0
It has to take an optional parameter that specifies a single type and then prints the dual type chart for that type, which looks like:
Attacking Type
No Fi Fl Po Gr Ro Bu Gh St Fr Wa Gr El Ps Ic Dr Da Fa
Electric/- 1.0 1.0 0.5 1.0 2.0 1.0 1.0 1.0 0.5 1.0 1.0 1.0 0.5 1.0 1.0 1.0 1.0 1.0
Electric/Normal 1.0 2.0 0.5 1.0 2.0 1.0 1.0 0.0 0.5 1.0 1.0 1.0 0.5 1.0 1.0 1.0 1.0 1.0
D Electric/Fighting 1.0 1.0 1.0 1.0 2.0 0.5 0.5 1.0 0.5 1.0 1.0 1.0 0.5 2.0 1.0 1.0 0.5 2.0
e Electric/Flying 1.0 0.5 0.5 1.0 0.0 2.0 0.5 1.0 0.5 1.0 1.0 0.5 1.0 1.0 2.0 1.0 1.0 1.0
f Electric/Poison 1.0 0.5 0.5 0.5 4.0 1.0 0.5 1.0 0.5 1.0 1.0 0.5 0.5 2.0 1.0 1.0 1.0 0.5
e Electric/Ground 1.0 1.0 0.5 0.5 2.0 0.5 1.0 1.0 0.5 1.0 2.0 2.0 0.0 1.0 2.0 1.0 1.0 1.0
n Electric/Rock 0.5 2.0 0.3 0.5 4.0 1.0 1.0 1.0 1.0 0.5 2.0 2.0 0.5 1.0 1.0 1.0 1.0 1.0
d Electric/Bug 1.0 0.5 1.0 1.0 1.0 2.0 1.0 1.0 0.5 2.0 1.0 0.5 0.5 1.0 1.0 1.0 1.0 1.0
i Electric/Ghost 0.0 0.0 0.5 0.5 2.0 1.0 0.5 2.0 0.5 1.0 1.0 1.0 0.5 1.0 1.0 1.0 2.0 1.0
n Electric/Steel 0.5 2.0 0.3 0.0 4.0 0.5 0.5 1.0 0.3 2.0 1.0 0.5 0.5 0.5 0.5 0.5 1.0 0.5
g Electric/Fire 1.0 1.0 0.5 1.0 4.0 2.0 0.5 1.0 0.3 0.5 2.0 0.5 0.5 1.0 0.5 1.0 1.0 0.5
Electric/Water 1.0 1.0 0.5 1.0 2.0 1.0 1.0 1.0 0.3 0.5 0.5 2.0 1.0 1.0 0.5 1.0 1.0 1.0
T Electric/Grass 1.0 1.0 1.0 2.0 1.0 1.0 2.0 1.0 0.5 2.0 0.5 0.5 0.3 1.0 2.0 1.0 1.0 1.0
y Electric/Psychic 1.0 0.5 0.5 1.0 2.0 1.0 2.0 2.0 0.5 1.0 1.0 1.0 0.5 0.5 1.0 1.0 2.0 1.0
p Electric/Ice 1.0 2.0 0.5 1.0 2.0 2.0 1.0 1.0 1.0 2.0 1.0 1.0 0.5 1.0 0.5 1.0 1.0 1.0
e Electric/Dragon 1.0 1.0 0.5 1.0 2.0 1.0 1.0 1.0 0.5 0.5 0.5 0.5 0.3 1.0 2.0 2.0 1.0 2.0
Electric/Dark 1.0 2.0 0.5 1.0 2.0 1.0 2.0 0.5 0.5 1.0 1.0 1.0 0.5 0.0 1.0 1.0 0.5 2.0
Electric/Fairy 1.0 0.5 0.5 2.0 2.0 1.0 0.5 1.0 1.0 1.0 1.0 1.0 0.5 1.0 1.0 0.0 0.5 1.0
The best dual type charts I've found is here, don't forget to list even the non-existent combinations, by clicking 'Show all types'. Types combine by multiplication, except for the same time (eg. electric/electric which is actually electric/-). White space in the output is only important between columns and rows (to remain legibility).
This is code golf so shortest bytes wins.
Fighting
and the numbers. There are only three spaces in between theElectric/Fighting
and the numbers. \$\endgroup\$ – ericw31415 Jan 2 '17 at 15:23