Simple Pokédex
Tags: beginners, python, codecademy
Published: 2022-11-23 04:36:56

**This project is a Codecademy assignment. The project objectives are as follows:** 

- Store data in a data structure

- Use an algorithm to sort or search for data within a data structure

- Use Git version control

- Use the command line and file navigation

- Write a technical blog post on the project

  

**This project consists of two main parts:**

1. 
Implementing an autocomplete that, based on a user’s input, returns a list of possible categories based on the beginning of a word. You should use the data created in the last step to create the autocomplete. It is up to you how to properly store and retrieve the data.

2. 
Retrieving and displaying all of the data related to the category selected by the user. It is up to you how to properly store and retrieve the data.

  

**A Brief introduction to Pokémon stats and types:**

Pokémon stats consists of:

- Total

- HP

- Attack

- Defense

- Sp. Atk

- Sp. Def

- Speed

Each Pokémon has all of the above stats and will be assigned a value to each stats

Example Pokémon stats:

Bulbasaur 
 Stats: {'Total': 318, 'HP': 45, 'Attack': 49, 'Defense': 49, 'Sp. Atk': 65, 'Sp. Def': 65, 'Speed': 45}


Pokémon types consists of:

- Normal

- Fire

- Water

- Grass

- Electric

- Ice

- Fighting

- Poison

- Ground

- Flying

- Psychic

- Bug

- Rock

- Ghost

- Dark

- Dragon

- Steel

- Fairy

Each Pokémon can have one or two types

Example Pokémon with a single type:

Charmander
 Type: ['FIRE']

<br/>Example Pokémon with two types:

Bulbasaur
 Type: ['GRASS', 'POISON']
  
<br/>**The Program's functionality**
Currently there are 905 Pokémons, the program will sort through all Pokémons and display the Pokémon(s) that matches the sorting criteria/criterion.

On startup the program will prompt the user with two options: 

![Display Options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjnxi1vdcq1kput7i9iu.png)

Option 1 will display all 905 Pokémons.
Option 2 will prompt the user to enter a letter/word; then displays all Pokémons with the specified letter/word

After the Pokémons are displayed the user will be prompted with 2 options:

![Sort Selection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7jvz7mmufk6kt80zf8j.png)

Depending on which option the user chooses, the program will prompt the user with a menu regarding to that option

Option 1 will bring the user to the "Pokémon Type Sort Menu"
Option 2 will bring the user to the "Pokémon Stats Sort Menu"

Pokémon Type Sort Menu:

- The user will be prompted with 3 options
![Pokemon Type Sort Selection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qejze3gh0sy7ed8br864.png) 
  1. The user will be prompted with 3 more options
       ![Pokémon Any Type Sort](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0xwcai84puxpjtd78j7.png)
          1. Prompt's the user to input <u>1</u> Pokémon type; then displays all Pokémon that has the specified type
          2. Prompt's the user to input <u>2</u> Pokémon type; then displays all Pokémon with the specified types
          3. Displays all existing Pokémon types
  2. Prompt's the user to input a Pokémon type; then displays all Pokémon with <u>ONLY</u> the specified type
  3. Displays all existing Pokémon types

Pokémon Stats Type Sort Menu:

- The user will be prompted with 2 options
![Pokémon Stats Type Select](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1p298caahaelamsqtt8e.png
)
  1. Prompt's the user to input a Pokémon stats type, and input a stat value. The user will then be prompted with 3 options
![Pokémon Stats Criterion Select](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unidp7j765fhb9g92i0f.png)
      1. The user inputted stat type will be used to compare against the user inputted value. Displays the Pokémon(s) with the corresponding stat type value greater than or equal to the inputted value
      2. Displays the Pokémon(s) with the corresponding stat type value less than or equal to the inputted value
      3. Displays the Pokémon(s) with the corresponding stat type value that matches the inputted value
  2. Displays all existing Pokémon stats types

**Time complexity**
- Search functions: O(n)
- Sort functions: O(n log n)

Where n is a list of Pokémon(s) 

**Links**
Github repo: [Simple Pokédex repo](https://github.com/danishhilman/recommendation-program)
Data gathered from: [pokemondb.net](https://pokemondb.net/pokedex/all)