Skip to content

A command-line interface for exploring the world of Pokemon. This interactive CLI allows you to navigate through locations, encounter Pokemon, attempt to catch them, and build your personal Pokedex.

Notifications You must be signed in to change notification settings

xonoxc/pokedexcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokedex CLI

A command-line interface for exploring the world of Pokemon. This interactive CLI allows you to navigate through locations, encounter Pokemon, attempt to catch them, and build your personal Pokedex.

Features

  • Location Exploration: Browse through different areas in the Pokemon world
  • Pokemon Encounters: Discover which Pokemon can be found in specific locations
  • Catching Mechanism: Attempt to catch Pokemon with experience-based catch rates
  • Pokedex Management: Keep track of your caught Pokemon and inspect their details
  • Interactive REPL: User-friendly command-line interface with helpful commands

Installation

Prerequisites

  • Go 1.25.5 or later

Build from Source

git clone https://github.com/xonoxc/pokedex.git
cd pokedex
go build -o pokedexcli .

Usage

Run the application:

./pokedexcli

Available Commands

Command Description Usage
help Displays available commands and usage information help
exit Exits the CLI application exit
map Browse through Pokemon locations map front or map back
explore Explore a specific location for Pokemon encounters explore <location-name>
catch Attempt to catch a Pokemon catch <pokemon-name>
inspect View detailed information about a Pokemon inspect <pokemon-name>
pokedex Display all Pokemon you've caught pokedex

Example Session

pokedex> map front
- pallet-town
- viridian-city
- pewter-city

pokedex> explore pallet-town
Exploring location.... pallet-town
Encounters found:
-pikachu
-rattata
-pidgey

pokedex> catch pikachu
Throwing a pokeball at pikachu...Catch chance: 65%
pikachu was caught!

pokedex> inspect pikachu
Name: pikachu
Height: 4
Weight: 60
Stats:
  - hp: 35
  - attack: 55
  - defense: 40
Types:
  - electric

pokedex> pokedex
Your Pokedex
-pikachu

Catch Rate Mechanics

The catch success rate is calculated based on the Pokemon's base experience:

  • Base rate of 70% with difficulty scaling
  • Higher experience Pokemon are harder to catch
  • Minimum catch rate of 5% ensures no Pokemon is impossible to catch

API Integration

This application uses the PokeAPI (pokeapi.co) to fetch:

  • Location data and navigation
  • Pokemon encounter information
  • Detailed Pokemon statistics

Development

Running Tests

go test ./...

Project Structure

pokedexcli/
├── main.go              # Application entry point and REPL
├── commands/            # CLI command implementations
├── internal/
│   ├── http_client/     # API client for PokeAPI
│   └── pokecache/       # Caching layer for API responses
└── repl/               # REPL utilities and input handling

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • PokeAPI for providing the Pokemon data API
  • The Go community for excellent tooling and libraries

About

A command-line interface for exploring the world of Pokemon. This interactive CLI allows you to navigate through locations, encounter Pokemon, attempt to catch them, and build your personal Pokedex.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages