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

saving for safety

parent 1c4a429f
// Pokemon List // Pokemon List
typedef struct PokemonNode typedef struct PokemonNode
{ {
char pokemonName[20]; char name[20];
char pokemonType[20]; char type[20];
char pokemonAbility[30]; char ability[30];
struct PokemonNode *next; struct PokemonNode *next;
} PokemonNode; } PokemonNode;
...@@ -11,7 +11,7 @@ typedef struct PokemonNode ...@@ -11,7 +11,7 @@ typedef struct PokemonNode
// Player List // Player List
typedef struct PlayerNode typedef struct PlayerNode
{ {
char playerName[50]; char name[50];
int totalPokemon; int totalPokemon;
PokemonNode *PokemonArray[20]; PokemonNode *PokemonArray[20];
struct PlayerNode *next; struct PlayerNode *next;
...@@ -24,19 +24,23 @@ typedef struct Pokedex ...@@ -24,19 +24,23 @@ typedef struct Pokedex
PlayerNode *PlayerNodehead; PlayerNode *PlayerNodehead;
} Pokedex; } Pokedex;
// Pokemon List functions // Pokemon List functions
PokemonNode* NewPokemonNode(char name[15], char type[20], char ability[30]); PokemonNode* NewPokemonNode(char name[20], 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[20], char type[20], char ability[30]);
PokemonNode* FindPokemon(Pokedex pokedex, char name[15]); PokemonNode* FindPokemon(Pokedex pokedex, char name[20]);
// Player List functions // Player List functions
PlayerNode* NewPlayerNode(char name[50]); PlayerNode* NewPlayerNode(char name[50]);
void AddPlayerToList(Pokedex *pokedex, char name[50]); void AddPlayerToList(Pokedex *pokedex, char name[50]);
PlayerNode* FindPlayer(Pokedex pokedex, char name[50]); PlayerNode* FindPlayer(Pokedex pokedex, char name[50]);
// Additional functions // Additional functions
void AddPokemonToPlayer(Pokedex pokedex, playerName[50], pokemonName[15]); void AddPokemonToPlayer(Pokedex pokedex, char playerName[50], char pokemonName[20]);
void DisplayPokemonDetails(pokedex, name); void DisplayPokemonDetails(Pokedex *pokedex, char name[20]);
void DisplayPlayerDetails(pokedex, name); void DisplayPlayerDetails(Pokedex *pokedex, char name[50]);
void ListPokemon(Pokedex* pokedex); void ListPokemon(Pokedex* pokedex);
void ListPlayers(Pokedex* pokedex); void ListPlayers(Pokedex* pokedex);
void AddToPokemonArray(Pokedex *pokedex, char namePoke[20], char namePlayer[50]);
...@@ -6,6 +6,17 @@ ...@@ -6,6 +6,17 @@
int main(void) 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