-
-
Save exelotl/dd79bdad5b2366ba7a94d27b9e861a34 to your computer and use it in GitHub Desktop.
Pokemon type matchup table example with labelled items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PokeType = enum | |
Fire | |
Water | |
Grass | |
Electric | |
const matchups: array[Fire..Electric, array[Fire..Electric, float]] = [ | |
Fire: [ | |
Fire: 0.5, | |
Water: 0.5, | |
Grass: 2.0, | |
Electric: 1.0, | |
], | |
Water: [ | |
Fire: 2.0, | |
Water: 0.5, | |
Grass: 0.5, | |
Electric: 1.0, | |
], | |
Grass: [ | |
Fire: 0.5, | |
Water: 2.0, | |
Grass: 0.5, | |
Electric: 1.0, | |
], | |
Electric: [ | |
Fire: 1.0, | |
Water: 2.0, | |
Grass: 0.5, | |
Electric: 0.5, | |
], | |
] | |
echo matchups[Fire][Grass] # 2.0, it's super effective! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment