Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pokedex Application
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
billy.gaines
Pokedex Application
Commits
16456b62
Commit
16456b62
authored
Jan 14, 2022
by
billy.gaines
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update main.c
parent
dc9a86ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
main.c
main.c
+61
-0
No files found.
main.c
View file @
16456b62
#include "Functions.h"
#include "Functions.c"
// -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
// Main
int
main
(
void
){
// Creation of Pokedex node
Pokedex
*
pokedex
=
NULL
;
// Create pokedex pointer and set to NULL.
pokedex
=
malloc
(
sizeof
(
pokedex
));
// Create pokedex node in memory and assign pokedex pointer to this node.
pokedex
->
Poke_head
=
NULL
;
// Within pokedex node: Set the head pointers for each list to NULL.
pokedex
->
Player_head
=
NULL
;
// ^
// Populate Pokemon List
AddPokemonToList
(
&
pokedex
,
"Charizard"
,
"Fire"
,
"Flameblast"
,
""
);
AddPokemonToList
(
&
pokedex
,
"Charmellian"
,
"Fire"
,
"Flamethrower"
,
"Charizard"
);
AddPokemonToList
(
&
pokedex
,
"Charmander"
,
"Fire"
,
"Flame"
,
"Charmellian"
);
AddPokemonToList
(
&
pokedex
,
"Squirtle"
,
"Water"
,
"Water Gun"
,
"Wartortle"
);
AddPokemonToList
(
&
pokedex
,
"Bulbasaur"
,
"Grass"
,
"Grass Knot"
,
"Ivysaur"
);
AddPokemonToList
(
&
pokedex
,
"Pidgy"
,
"Flying"
,
"Arial Ace"
,
"Pidgeotto"
);
AddPokemonToList
(
&
pokedex
,
"Caterpie"
,
"Bug"
,
"String Shot"
,
"Metapod"
);
AddPokemonToList
(
&
pokedex
,
"Pikachu"
,
"Electric"
,
"Thunderbolt"
,
"Raichu"
);
AddPokemonToList
(
&
pokedex
,
"Nidoran"
,
"Grass"
,
"Poison Shot"
,
"Nidorina"
);
AddPokemonToList
(
&
pokedex
,
"Zubat"
,
"Dark"
,
"Bite"
,
"Golbat"
);
AddPokemonToList
(
&
pokedex
,
"Diglet"
,
"Ground"
,
"Dig"
,
"Dugtrio"
);
AddPokemonToList
(
&
pokedex
,
"Abra"
,
"Psychic"
,
"Hidden Power"
,
"Kadabra"
);
// Populate Player List
AddPlayerToList
(
&
pokedex
,
"Billy"
);
AddPlayerToList
(
&
pokedex
,
"Beth"
);
AddPlayerToList
(
&
pokedex
,
"Jim"
);
// Populate Player Pokemon
AddPokemonToPlayer
(
pokedex
,
"Billy"
,
"Charmander"
);
AddPokemonToPlayer
(
pokedex
,
"Billy"
,
"Abra"
);
AddPokemonToPlayer
(
pokedex
,
"Billy"
,
"Pikachu"
);
AddPokemonToPlayer
(
pokedex
,
"Beth"
,
"Bulbasaur"
);
AddPokemonToPlayer
(
pokedex
,
"Beth"
,
"Nidoran"
);
AddPokemonToPlayer
(
pokedex
,
"Beth"
,
"Abra"
);
AddPokemonToPlayer
(
pokedex
,
"Jim"
,
"Squirtle"
);
AddPokemonToPlayer
(
pokedex
,
"Jim"
,
"Pidgy"
);
AddPokemonToPlayer
(
pokedex
,
"Jim"
,
"Zubat"
);
// Evolve Player Pokemon
EvolvePlayerPokemon
(
pokedex
,
"Billy"
,
"Charmander"
);
EvolvePlayerPokemon
(
pokedex
,
"Billy"
,
"Charmellian"
);
// Function Calls
ListPokemon
(
pokedex
);
ListPlayers
(
pokedex
);
DisplayPlayerDetails
(
pokedex
,
"Billy"
);
DisplayPlayerDetails
(
pokedex
,
"Beth"
);
DisplayPlayerDetails
(
pokedex
,
"Jim"
);
DisplayPokemonDetails
(
pokedex
,
"Charmander"
);
DisplayPokemonDetails
(
pokedex
,
"Squirtle"
);
DisplayPokemonDetails
(
pokedex
,
"Bulbasaur"
);
return
0
;
}
\ No newline at end of file
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