Commit 1c4a429f authored by elijah vasquez's avatar elijah vasquez 🦍

reorganised

parent 8ca6dec1
typedef struct Pokedex // Pokedex structure
// Pokemon List
typedef struct PokemonNode
{
PokemonNode *headNode;
PlayerNode *headPlayer;
}Pokedex;
typedef struct PokemonNode // Pokemon List
{
char pokemonName[15];
char pokemonType[15];
char pokemonName[20];
char pokemonType[20];
char pokemonAbility[30];
}PokemonNode;
typedef struct PlayerNode // Player List
struct PokemonNode *next;
} PokemonNode;
// Player List
typedef struct PlayerNode
{
char playerName[50];
int totalPokemon;
PokemonNode PokemonArray[20];
}PlayerNode;
PokemonNode *PokemonArray[20];
struct PlayerNode *next;
} PlayerNode;
// Pokedex structure
typedef struct Pokedex
{
PokemonNode *pokemonNodehead;
PlayerNode *PlayerNodehead;
} Pokedex;
// Pokemon List functions
PokemonNode* NewPokemonNode(char name[15], char type[20], char ability[30]);
void AddPokemonToList(Pokedex *pokedex, char name[15], char type[20], char ability[30]);
void AddPokemonToList(Pokedex **pokedex, char name[15], char type[20], char ability[30]);
PokemonNode* FindPokemon(Pokedex pokedex, char name[15]);
// Player List functions
PlayerNode* NewPlayerNode(char name[50]);
void AddPlayerToList(Pokedex *pokedex, char name[50]);
PlayerNode* FindPlayer(pokedex, char name[50]);
PlayerNode* FindPlayer(Pokedex pokedex, char name[50]);
// Additional functions
void AddPokemonToPlayer(pokedex, playerName[50], pokemonName[15]);
void AddPokemonToPlayer(Pokedex pokedex, playerName[50], pokemonName[15]);
void DisplayPokemonDetails(pokedex, name);
void DisplayPlayerDetails(pokedex, name);
void ListPokemon(pokedex);
void ListPlayers(pokedex);
void ListPokemon(Pokedex* pokedex);
void ListPlayers(Pokedex* pokedex);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "functions.h"
int main(void)
{
Pokedex pokedex; // Variable of Pokedex
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment