Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- void pokemonSelection(char *c1stName,char *c2ndName){
- char cPokemon1, cPokemon2;
- printf("\n\t %5s's Pokemon \t\t\t\t\t\t\t %5s's Pokemon \n", c1stName,c2ndName);
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t|| ||\t\t\t\t\t\t\t|| || \n");
- printf("\t ============= \t\t\t\t\t\t\t =============\n");
- printf("\n\tProfessor Oak: %5s, please select your pokemon.", c1stName); // pokemon selection phase
- scanf("%c", &cPokemon1);
- printf("\n\tProfessor Oak: %5s, please select your pokemon.", c2ndName);
- scanf("%c", &cPokemon2);
- }
- void firstPart(){
- char c1stName[5],c2ndName[5];
- /* gets the names of the two
- players */
- printf("(5characters only)\n");
- printf("Player 1 NAME:");
- scanf("%s", c1stName);
- fflush(stdin);
- printf("\nPlayer 2 NAME:");
- scanf("%s", c2ndName);
- fflush(stdin);
- pokemonSelection(c1stName, c2ndName);
- }
- void start(){ // main screen
- char cChoice;
- printf("\t\t\t\t\t\t Enter:");
- scanf("%c", &cChoice);
- fflush(stdin);
- printf("\n");
- cChoice = tolower(cChoice); // to make the reply valid for lower and uppercase input
- if (cChoice == 'a' ){ // proceed to the main game
- firstPart();
- }
- else if (cChoice == 'b'){ // exits the program
- printf("\t\t\t\t\t THANK YOU FOR PLAYING");
- }
- else{ // invalid output
- printf("\t\t\t\t\t\t Wrong Input.\n");
- start();
- }
- }
- int main()
- {
- printf("\t\t\t\t ==============================================\n");
- printf("\t\t\t\t|| ||\n");
- printf("\t\t\t\t|| ||\n");
- printf("\t\t\t\t|| 1 V 1 ||\n");
- printf("\t\t\t\t|| ||\n");
- printf("\t\t\t\t|| POKEMON BATTLE SIMULATOR ||\n");
- printf("\t\t\t\t|| ||\n");
- printf("\t\t\t\t|| ||\n");
- printf("\t\t\t\t|| ||\n");
- printf("\t\t\t\t ==============================================\n\n");
- printf("\t\t\t\t [A] [B] \n");
- printf("\t\t\t\t START END \n");
- start();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement