Commit 4b62ef45 authored by jamilah.hamade's avatar jamilah.hamade

Add new file

parents
#include <stdio.h>
#include <stdlib.h>
typedef struct PokemonNode { //struct created for PokemonNode
char Name[10]; //name of pokemon that can't exceed 10 characters.
char Type[10]; // type of pokemon that can't exceed 10 characters.
char Ability [50];// pokemon's ability, max of 50 characters.
struct PokemonNode * next; //pointer to next PokemonNode
}; PokemonNode;
typedef struct PlayerNode {
char PlayerName[10]; //player's name, can't exceed 10 characters.
int Pokemonsowned; // number of pokemon's owned by player.
// an array of pointers to the pokemons owned by each player
struct PlayerNode * next; // Pointer to next PlayerNode
}; PlayerNode;
struct Pokedox {
//two pointers – one to the head of the player list and one to the head of the Pokemon list.
};
int main() {
printf("Hello, enter one of the following numbers\n1.Display Pokemon list\n2.Display player list\n3.Add new pokemon\n4.Add new player\n" );
int a ;
scanf("%d", &a); //check which option user entered
struct PokemonNode * head = NULL; //head of pokemon list created
struct PokemonNode * NewPokemonNode1(char Spectrier, char Ghost, char Grim_Neigh);
struct PokemonNode * NewPokemonNode2(char Glastrier, char Ice, char Chilling_Neigh);
struct PokemonNode * NewPokemonNode3(char Zacian, char Fairy, char Intrepid_Sword);
if (a == 1){
//Pokemon list
printf("Pokemon1: name: Spectrier, type: Ghost, primary ability: Grim Neigh \n Pokemon2: name: Glastrier, type: Ice, primary ability: Chilling Neigh \n Pokemon3: name: Zacian , type: Fairy, primary ability: Intrepid Sword \n" );
}
else if (a == 2) {
struct PlayerNode * head = NULL; //head of player list created
struct PlayerNode * NewPlayerNode1(char Vera, int [2]);
struct PlayerNode * NewPlayerNode2(char Mateo, int [1]);
printf("Player 1: name: Vera, number of pokemon owned: 2 \n Player 2: name: Mateo, number of pokemon owned: 1 \n" );
}
else if (a == 3){
printf("Insert new Pokemon name:\n" );
void AddPokemonToList(*pokedox,name,type,ability);
char b;
scanf("%s",&b);
printf("\n %s is added to pokemon list\n", &b);
return 0;
}
else if (a == 4){
void AddPlayerToList(*pokedox,name);
printf("Insert new player's name:\n" );
char c;
scanf("%s", &c);
printf("\n %s is added to player list\n",&c );
return 0;
}
}
\ No newline at end of file
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