Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include "Pokedex.h"
- #include "Pokemon.h"
- int menu(void) {
- int opt;
- printf("Escolha a opcao\n");
- printf("0. Sair\n");
- printf("1. Pokemon Capturado\n");
- printf("2. Exibir Pokedex\n");
- printf("3. Exibir Bolsa Pokemon\n");
- printf("4. Saber as informacoes de um pokemon\n");
- //printf("5. ")
- printf("Opcao: "); scanf("%d", &opt);
- return opt;
- }
- int main () {
- tPokedex Px;
- tPokeBag Pb;
- int num, opt;
- if (initPokedex(&Px) == false) { //iniciando a Pokedex
- printf("Nao foi possivel cria a Pokedex\n");
- exit(0);
- }
- initBag(&Pb);
- do {
- opt = menu();
- switch(opt) {
- case 1:
- printf("Insiria o ID do Pokemon\n");
- scanf("%d", &num);
- system("clear");
- inserirPokemon(&Px, num);
- insereOrdenadoBag(&Pb, num);
- printf("----------------------------------------------------------");
- printf("\n\n");
- break;
- case 2:
- system("clear");
- imprimirPokedex(Px);
- printf("\n\n");
- break;
- case 3:
- system("clear");
- imprimeBag(Pb);
- printf("\n\n");
- break;
- case 4:
- printf("Insiria o ID do Pokemon\n");
- scanf("%d", &num);
- system("clear");
- if (!buscaPokemon (Px, num))
- printf("Voce nao possui esse Pokemon!!\n");
- else
- InfoPokemon (Px, num);
- break;
- case 0:
- system("clear");
- limpaBag(&Pb);
- limparPokedex(&Px);
- printf("\n\n\n");
- break;
- }
- }while(opt);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment