A simple Pokemon battle simulator demonstrating a knowledgeable use of maps, sets, and binary search trees
Pokemon are creatures that use specific moves to fight each other. Every Pokemon and every move is of a certain type (water, fire, steel, etc), and certain types are either effective, normal, or not effective against other types.
The simulator functions using four main maps:
- Pokemon: pokemon names keyed to their type
- Moves: move names keyed to their type
- Effectivities: types keyed to the set of types they are effective against
- Ineffectivities: types keyed to the set of types they are ineffective against
The following commands are used to operate the simulator:
- Pokemon: name type adds the Pokemon to the map of Pokemon
- Moves: name type adds the move to the map of moves
- Effective: type type type ... type adds a type to the map of effectivities, with the value being the types it is effective against
- Ineffective: type type type ... type adds a type to the map of ineffectivities, with the value being the types it is ineffective against
- Pokemon
- Moves
- Effectivities
- Ineffectivities
- Battle: PokemonA moveA PokemonB MoveB outputs results of a battle between two specified pokemon using their specified moves, drawing from all four maps to determine the winner. The battle is essentially a game of rock, paper, scissors using the type effectiveness.
The PokemonData.txt file contains a massive database of pokemon, moves, effectivities, and ineffectivities. It is to be used as the main input file and will add every item to the corresponding map. At the end of the file, it contains the commands to output each of the four maps, and a sample battle command. More battle commands can be added as the user wishes.