printf("The Pokemon you are looking for is %s, the %s.\n",mainDex.pokemon[pokemonID].name,mainDex.pokemon[pokemonID].species);
if(isspace(mainDex.pokemon[pokemonID].type2[0])){
printf("%s is a %s type, ",mainDex.pokemon[pokemonID].name,mainDex.pokemon[pokemonID].type1);
}
else{
printf("%s has types %s and %s, ",mainDex.pokemon[pokemonID].name,mainDex.pokemon[pokemonID].type1,mainDex.pokemon[pokemonID].type2);
}
printf("it is %.2fm tall and %.2fkg in weight and has the ability %s. ",((float)mainDex.pokemon[pokemonID].height/10),((float)mainDex.pokemon[pokemonID].weight/10),mainDex.pokemon[pokemonID].ability);
if(mainDex.pokemon[pokemonID].dimorphic=="TRUE"){
printf("This Pokemon is sexually dimorphic, which means that the males and females of this species look different! ");
}else{
printf("This Pokemon isn't sexually dimorphic, which means that the males and females of this species look the same! ");
printf("%s evolved from %s, and will evolve into %s.",mainDex.pokemon[pokemonID].name,mainDex.pokemon[pokemonID].evolveFrom,mainDex.pokemon[pokemonID].evolveTo);
printf("%s will evolve into %s.",mainDex.pokemon[pokemonID].name,mainDex.pokemon[pokemonID].evolveTo);
}
else{
printf("%s has no known evolutions.",mainDex.pokemon[pokemonID].name);
}
printf("\n");
}
char*stripSpace(char*string){
charfinal[100];
intc=0,d=0;
while(string[c]!='\0')
{
if(!(string[c]==' '&&string[c+1]==' ')){
final[d]=string[c];
d++;
}
c++;
}
string[d]='\0';
string[strcspn(string,"\n")]=0;
//printf("\n%s<-ends here", string);
returnstring;
}
intidentify(){
intchoice=0;
intarrayLength;
while(choice!='6'){
printf("\nHow would you like to identify this Pokemon?\n1. By Name\t\t2. By ID\n3. By Primary Type\t4. By Secondary Type\n5. Trainer Info\t\t6. Exit\n\nEnter Your Choice: ");
choice=getch();
printf("%d",choice);
switch(choice){
case'1':
printf("\nEnter the Pokemon's Name: ");
charstr[13];
fgets(str,13,stdin);
str[0]=toupper(str[0]);
stripSpace(str);
intcount=-1;
intcomparitor=1;
charnameStr[12];
while(comparitor!=0&&count<=720){
count++;
strcpy(nameStr,mainDex.pokemon[count].name);
comparitor=strcmp(str,nameStr);
}
if(!comparitor){
printPokemon(count);
}
else{
printf("We couldn't find that Pokemon, could you check the spelling?\n");
}
break;
case'2':
printf("\nEnter the Pokemon's ID: ");
intpokeID;
scanf("%d",&pokeID);
if(1<=pokeID&&pokeID<722){
printPokemon(pokeID-1);
}
else{
printf("That value is out of range of this Pokedex, please try a value between 1 and 721\n");