Commit 2d99774c authored by elijah vasquez's avatar elijah vasquez 🦍

saving for safety

parent 1c4a429f
// Pokemon List
typedef struct PokemonNode
{
char pokemonName[20];
char pokemonType[20];
char pokemonAbility[30];
char name[20];
char type[20];
char ability[30];
struct PokemonNode *next;
} PokemonNode;
......@@ -11,7 +11,7 @@ typedef struct PokemonNode
// Player List
typedef struct PlayerNode
{
char playerName[50];
char name[50];
int totalPokemon;
PokemonNode *PokemonArray[20];
struct PlayerNode *next;
......@@ -24,19 +24,23 @@ typedef struct Pokedex
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]);
PokemonNode* FindPokemon(Pokedex pokedex, char name[15]);
PokemonNode* NewPokemonNode(char name[20], char type[20], char ability[30]);
void AddPokemonToList(Pokedex **pokedex, char name[20], char type[20], char ability[30]);
PokemonNode* FindPokemon(Pokedex pokedex, char name[20]);
// Player List functions
PlayerNode* NewPlayerNode(char name[50]);
void AddPlayerToList(Pokedex *pokedex, char name[50]);
PlayerNode* FindPlayer(Pokedex pokedex, char name[50]);
// Additional functions
void AddPokemonToPlayer(Pokedex pokedex, playerName[50], pokemonName[15]);
void DisplayPokemonDetails(pokedex, name);
void DisplayPlayerDetails(pokedex, name);
void AddPokemonToPlayer(Pokedex pokedex, char playerName[50], char pokemonName[20]);
void DisplayPokemonDetails(Pokedex *pokedex, char name[20]);
void DisplayPlayerDetails(Pokedex *pokedex, char name[50]);
void ListPokemon(Pokedex* pokedex);
void ListPlayers(Pokedex* pokedex);
void AddToPokemonArray(Pokedex *pokedex, char namePoke[20], char namePlayer[50]);
......@@ -6,6 +6,17 @@
int main(void)
{
Pokedex *pokedexNode = NULL;
pokedexNode = malloc(sizeof(struct PokemonNode));
pokedexNode -> pokemonNodehead = NULL;
pokedexNode -> PlayerNodehead = NULL;
// Calling functs. to create list of Pokemon
// Calling functs. to create list of players
}
No preview for this file type
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