Read-Execute-Print-Loop (REPL) Pokédex Application with caching.
Features:
- Ability to catch and inspect Pokémon in the terminal
- Usage of PokéAPI to deliver up to date and full Pokémon information
- Caching of PokéAPI pages to optimize user experience
- CLI input sanitation
- Unit testing to ensure smooth and robust development and maintenance
Ensure you have Go v1.22+ installed on your system.
From the project's root directory, use the Go command-line tool to build the executable:
go build -o pokedex
This command generates an executable named pokedex
.
Execute the binary in your terminal to enter the Pokédex command line:
./pokedex
The command line should show the following prompt:
pokedexCLI >
Exit the CLI tool with the exit
command or by pressing CTRL + C
.
- catch <pokemon_name/id>
- inspect <pokemon_name/id>
- pokedex
- map
- mapb
- explore <location_area_name/id>
- help
- exit
Accepts one argument: <pokemon_name/id>
Attempt to catch a pokemon. Rolls a random integer between 1 and the pokémon's base experience. Stronger pokémon have higher base experience. If the roll is 50 or lower, the pokémon is caught and added to the pokédex.
Example usage:
pokedexCLI > catch mew
pokedexCLI > catch 151
Accepts one argument: <pokemon_name/id>
Prints information about a specified pokémon, if they have been added to the pokédex.
Example usage:
pokedexCLI > inspect mew
pokedexCLI > inspect 151
Lists all the pokémon that have been added to the pokédex so far.
Lists all the location areas on the following page of location areas from the PokéAPI.
Lists all the location areas on the previous page of location areas from the PokéAPI.
Accepts one argument: <location_area_name/id>
Lists the pokemon in a specified location area.
Example usage:
pokedexCLI > explore eterna-city-area
pokedexCLI > explore 2
Lists all commands and their description.
Exits the CLI tool.