7 releases
| 0.1.33 | May 25, 2025 |
|---|---|
| 0.1.32 | Oct 3, 2024 |
| 0.1.31 | Jul 29, 2024 |
| 0.1.3 | Jan 20, 2024 |
| 0.1.2 | Oct 3, 2023 |
#1377 in Development tools
374 downloads per month
120KB
5K
SLoC
Pokemon Utils
a collection of pokemon related utilities
use pokemon_utils::{self, is_rare, PokedexEntry};
fn main() {
let pokemon = pokemon_utils::encounter_random_pokemon();
// one way to convert pokemon index into an entry
let _: &PokedexEntry = PokedexEntry::get_by_id(pokemon as usize).unwrap();
// another way to do the conversion
let entry: &PokedexEntry = pokemon.try_into().unwrap();
println!("found a wild {}!", entry.name);
println!("is rare? {}", is_rare(&entry.index));
}
Resources
- https://msikma.github.io/pokesprite/index.html
- pokeapi
- explorer app: https://unpkg.com/css-chain-test@1.1.9/src/PokeApi-Explorer.html
- github: https://github.com/PokeAPI/sprites
- pokemon api example: https://pokeapi.co/api/v2/pokemon/1
- pikachu sprite examples
- https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png
- https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-ii/gold/transparent/25.png
- https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/versions/generation-iii/emerald/25.png
Dependencies
~485KB