DEV Community

Cover image for Simple Pokédex
danishhilman
danishhilman

Posted on

Simple Pokédex

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']


Example Pokémon with two types:

Bulbasaur
Type: ['GRASS', 'POISON']


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

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

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
    1. The user will be prompted with 3 more options Pokémon Any Type Sort
      1. Prompt's the user to input 1 Pokémon type; then displays all Pokémon that has the specified type
      2. Prompt's the user to input 2 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 ONLY 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
    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
      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
Data gathered from: pokemondb.net

Top comments (0)