Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
".fantomasignore": "ignore",
"iostream": "cpp",
"ostream": "cpp"
}
},
"C_Cpp.errorSquiggles": "disabled"
}
126 changes: 63 additions & 63 deletions MeetingProfessorOak.cpp
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
#include<iostream>
// #include<iostream>

using namespace std;
// using namespace std;

enum class PokemonChoice{
Bulbasaur,
Charmander,
Squirtle,
Invalid_Choice
// enum class PokemonChoice{
// Bulbasaur,
// Charmander,
// Squirtle,
// Invalid_Choice

};
// };

int main() {
string player_name;
PokemonChoice chosen_pokemon;
// int main() {
// string player_name;
// PokemonChoice chosen_pokemon;

cout << "What's up, kid! I'm Professor Oak, the Pokémon Professor!" << endl;
// cout << "What's up, kid! I'm Professor Oak, the Pokémon Professor!" << endl;

cout << "Wait... who are you again? Oh right, you must be the new trainer!" << endl;
// cout << "Wait... who are you again? Oh right, you must be the new trainer!" << endl;

cout << "Ah yes, before we begin, tell me your name, young one." << endl;
// cout << "Ah yes, before we begin, tell me your name, young one." << endl;

cin >> player_name;
// cin >> player_name;

cout << player_name << "?! Haha, that's a great name! It reminds me of when I was your age... but let's not get into that." << endl;
// cout << player_name << "?! Haha, that's a great name! It reminds me of when I was your age... but let's not get into that." << endl;

cout << "Hmm, looks like you don't have any Pokémon yet, do you?" << endl;
// cout << "Hmm, looks like you don't have any Pokémon yet, do you?" << endl;

cout << "Don't worry! Every great journey begins with a first step—and a Pokémon partner!" << endl;
// cout << "Don't worry! Every great journey begins with a first step—and a Pokémon partner!" << endl;

int playerChoice;
cout << "\nI've got three amazing Pokémon right here in front of me. Each one has a unique bond with nature. Choose wisely!" << endl;
// int playerChoice;
// cout << "\nI've got three amazing Pokémon right here in front of me. Each one has a unique bond with nature. Choose wisely!" << endl;

cout << "Here are your choices:\n";
// cout << "Here are your choices:\n";

cout << "1) Bulbasaur.\n2) Charmander.\n3) Squirtle.\n" << endl;
// cout << "1) Bulbasaur.\n2) Charmander.\n3) Squirtle.\n" << endl;

cout << "So, " << player_name << ", which Pokémon will be your loyal companion? Enter 1, 2, or 3: ";
cin >> playerChoice ;
cout<<"\n";
// cout << "So, " << player_name << ", which Pokémon will be your loyal companion? Enter 1, 2, or 3: ";
// cin >> playerChoice ;
// cout<<"\n";

switch (playerChoice)
{
case 1:
chosen_pokemon = PokemonChoice::Bulbasaur;
break;
case 2:
chosen_pokemon = PokemonChoice::Charmander;
break;
case 3:
chosen_pokemon = PokemonChoice::Squirtle;
break;
// switch (playerChoice)
// {
// case 1:
// chosen_pokemon = PokemonChoice::Bulbasaur;
// break;
// case 2:
// chosen_pokemon = PokemonChoice::Charmander;
// break;
// case 3:
// chosen_pokemon = PokemonChoice::Squirtle;
// break;

default:
chosen_pokemon = PokemonChoice::Invalid_Choice;
break;
}
// default:
// chosen_pokemon = PokemonChoice::Invalid_Choice;
// break;
// }


switch (chosen_pokemon)
{
case PokemonChoice::Bulbasaur:
cout << "You chose Bulbasaur! A wise choice indeed. This little guy will be your steady partner through thick and thin, trust me." << endl;
cout << "Bulbasaur looks up at you with big, trusting eyes, ready for an adventure!" << endl;
break;
case PokemonChoice::Charmander:
cout << "You chose Charmander! A fiery choice, full of energy and potential. Watch out, though, that tail flame means business!" << endl;
cout << "Charmander lets out a cheerful growl, its tail flame burning brightly as it anticipates the challenges ahead." << endl;
break;
case PokemonChoice::Squirtle:
cout << "You chose Squirtle! A cool, composed choice. This little turtle will help you navigate through any stormy waters you encounter." << endl;
cout << "Squirtle gives you a confident nod, ready to splash into battle whenever you are!" << endl;
default:
cout << "Professor Oak: Hmm, that doesn't seem right. Let me choose for you...\n";
chosen_pokemon = PokemonChoice::Charmander;
cout << "Professor Oak: Just kidding! Let's go with Charmander, the fiery dragon in the making!\n";
break;
break;
}
// switch (chosen_pokemon)
// {
// case PokemonChoice::Bulbasaur:
// cout << "You chose Bulbasaur! A wise choice indeed. This little guy will be your steady partner through thick and thin, trust me." << endl;
// cout << "Bulbasaur looks up at you with big, trusting eyes, ready for an adventure!" << endl;
// break;
// case PokemonChoice::Charmander:
// cout << "You chose Charmander! A fiery choice, full of energy and potential. Watch out, though, that tail flame means business!" << endl;
// cout << "Charmander lets out a cheerful growl, its tail flame burning brightly as it anticipates the challenges ahead." << endl;
// break;
// case PokemonChoice::Squirtle:
// cout << "You chose Squirtle! A cool, composed choice. This little turtle will help you navigate through any stormy waters you encounter." << endl;
// cout << "Squirtle gives you a confident nod, ready to splash into battle whenever you are!" << endl;
// default:
// cout << "Professor Oak: Hmm, that doesn't seem right. Let me choose for you...\n";
// chosen_pokemon = PokemonChoice::Charmander;
// cout << "Professor Oak: Just kidding! Let's go with Charmander, the fiery dragon in the making!\n";
// break;
// break;
// }

cout << "\nWell, " << player_name << ", your journey begins now. Go forth, explore the world of Pokémon with your mate " <<(chosen_pokemon == PokemonChoice::Charmander ? "Charmander" : chosen_pokemon == PokemonChoice::Bulbasaur ? "Bulbasaur" : "Squirtle")<< ", and remember—there's a whole world waiting for you!" << endl;
// cout << "\nWell, " << player_name << ", your journey begins now. Go forth, explore the world of Pokémon with your mate " <<(chosen_pokemon == PokemonChoice::Charmander ? "Charmander" : chosen_pokemon == PokemonChoice::Bulbasaur ? "Bulbasaur" : "Squirtle")<< ", and remember—there's a whole world waiting for you!" << endl;

return 0;
}
// return 0;
// }
47 changes: 47 additions & 0 deletions Player.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include "Player.hpp"
#include "PokemonChoice.hpp"
#include "PokemonType.hpp"
#include "Utility.hpp"
#include "iostream"
using namespace std;
Player :: Player(){
name = "Trainer";
chosenPokemon = Pokemon();
}

// Parameterized Constructor
Player :: Player(string p_name, Pokemon p_chosenPokemon){
name = p_name;
chosenPokemon = p_chosenPokemon;

}

// // copy contructor
// Player :: Player(const Player &p) {
// name = p.name;
// chosenPokemon = p.chosenPokemon;

// }

void Player :: choosePokemon(int choice) {
switch ((PokemonChoice)choice) {
case PokemonChoice::CHARMANDER:
chosenPokemon = Pokemon("Charmander", PokemonType::FIRE, 100);
break;
case PokemonChoice::BULBASAUR:
chosenPokemon = Pokemon("Bulbasaur", PokemonType::GRASS, 100);
break;
case PokemonChoice::SQUIRTLE:
chosenPokemon = Pokemon("Squirtle", PokemonType::WATER, 100);
break;
default:
chosenPokemon = Pokemon("Pikachu", PokemonType::ELECTRIC, 100);
break;
}
cout << "Player " << name << " chose " << chosenPokemon.name << "!\n";
Utility::waitForEnter();




}
16 changes: 16 additions & 0 deletions Player.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <string>
#include "Pokemon.hpp"
using namespace std;

class Pokemon;

class Player {
public:
string name;
Pokemon chosenPokemon;

Player(); // Default constructor
Player(std::string p_name, Pokemon p_chosenPokemon); // Parameterized constructor

void choosePokemon(int choice); // Method to choose a Pokemon
};
Binary file added Pokemon
Binary file not shown.
33 changes: 33 additions & 0 deletions Pokemon.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "Pokemon.hpp"
#include <iostream>
#include "PokemonType.hpp"
using namespace std;

Pokemon::Pokemon() {
name = "Unknown";
type = PokemonType::NORMAL;
health = 50;
}

// Parameterized constructor
Pokemon::Pokemon(string p_name, PokemonType p_type, int p_health) {
name = p_name;
type = p_type;
health = p_health;
}

// Copy constructor
Pokemon::Pokemon(const Pokemon &other) {
name = other.name;
type = other.type;
health = other.health;
}

// Destructor
Pokemon::~Pokemon() {
// Destructor logic (if any) goes here
}

void Pokemon::attack() {
cout << name << " attacks with a powerful move!\n";
}
25 changes: 25 additions & 0 deletions Pokemon.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <string>
using namespace std;

enum class PokemonType;

class Pokemon {
public:
string name;
PokemonType type;
int health;

// Default constructor
Pokemon();

// Parameterized constructor
Pokemon(string p_name, PokemonType p_type, int p_health);

// Copy constructor
Pokemon(const Pokemon &other);

// Destructor
~Pokemon();

void attack();
};
7 changes: 7 additions & 0 deletions PokemonChoice.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
enum class PokemonChoice{
CHARMANDER = 1,
BULBASAUR,
SQUIRTLE,
PIKACHU

};
8 changes: 8 additions & 0 deletions PokemonType.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

enum class PokemonType{
FIRE,
GRASS,
WATER,
ELECTRIC,
NORMAL
};
22 changes: 22 additions & 0 deletions Utility.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "Utility.hpp"
#include <iostream>
#include <limits>
using namespace std;

void Utility :: clearConsole(){
#ifdef _WIN32
system("cls");
#else
(void)system("clear");
#endif
}

void Utility :: waitForEnter(){
// cout << "(Press Enter to \033[34mcontinue\033[0m...)" << endl;


cin.get();
}
void Utility :: clearInputBuffer(){
cin.ignore(numeric_limits<streamsize>::max(), '\n');
}
6 changes: 6 additions & 0 deletions Utility.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Utility{
public:
static void clearConsole();
static void waitForEnter();
static void clearInputBuffer();
};
Binary file removed main
Binary file not shown.
Loading