Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
c_pokedex_assignment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
elijah vasquez
c_pokedex_assignment
Commits
2d99774c
Commit
2d99774c
authored
Jan 16, 2023
by
elijah vasquez
🦍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
saving for safety
parent
1c4a429f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
functions.h
functions.h
+14
-10
main.c
main.c
+11
-0
main.exe
main.exe
+0
-0
No files found.
functions.h
View file @
2d99774c
// Pokemon List
typedef
struct
PokemonNode
{
char
pokemonN
ame
[
20
];
char
pokemonT
ype
[
20
];
char
pokemonA
bility
[
30
];
char
n
ame
[
20
];
char
t
ype
[
20
];
char
a
bility
[
30
];
struct
PokemonNode
*
next
;
}
PokemonNode
;
...
...
@@ -11,7 +11,7 @@ typedef struct PokemonNode
// Player List
typedef
struct
PlayerNode
{
char
playerN
ame
[
50
];
char
n
ame
[
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
]);
main.c
View file @
2d99774c
...
...
@@ -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
}
main.exe
View file @
2d99774c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment