From 0faf5893122410c1c43ed6bb2fc0c12fb53409c8 Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Tue, 13 May 2025 09:01:13 +0530 Subject: [PATCH 01/10] Update main.cpp --- Pokemon/main.cpp | 85 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index c2bc7bfc..d6f2079a 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -1,6 +1,89 @@ #include +#include +using namespace std; + +// Define an enum for Pokemon choices +enum class PokemonChoice { + Charmander, + Bulbasaur, + Squirtle, + InvalidChoice +}; + +enum class PokemonType{ + Fire, + Electric, + Water, + Earth, + Normal +}; int main() { + // Variables to store player name and chosen Pokemon + string player_name; + PokemonChoice chosen_pokemon = PokemonChoice::InvalidChoice; // Default to an invalid choice + + // Introduction by the Professor + cout << "Professor Oak: Hello there! Welcome to the world of Pokemon!\n"; + cout << "Professor Oak: My name is Oak. People call me the Pokemon Professor!\n"; + cout << "Professor Oak: But enough about me. Let's talk about you!\n"; + + // Taking player name as input + cout << "Professor Oak: First, tell me, what’s your name?\n"; + cin >> player_name; + + cout << "Professor Oak: Ah, " << player_name << "! What a fantastic name!\n"; + cout << "Professor Oak: You must be eager to start your adventure. But first, you’ll need a Pokemon of your own!\n"; + + // Presenting Pokemon choices + cout << "Professor Oak: I have three Pokemon here with me. They’re all quite feisty!\n"; + cout << "Professor Oak: Choose wisely...\n"; + cout << "1. Charmander - The fire type. A real hothead!\n"; + cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; + cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; + + int choice; + cout << "Professor Oak: So, which one will it be? Enter the number of your choice: "; + cin >> choice; + + // Map the integer choice to the corresponding enum value + switch(choice) { + case 1: + chosen_pokemon = PokemonChoice::Charmander; + break; + case 2: + chosen_pokemon = PokemonChoice::Bulbasaur; + break; + case 3: + chosen_pokemon = PokemonChoice::Squirtle; + break; + default: + chosen_pokemon = PokemonChoice::InvalidChoice; + break; + } + + // Respond based on the chosen Pokemon + switch(chosen_pokemon) { + case PokemonChoice::Charmander: + cout << "Professor Oak: A fiery choice! Charmander is yours!\n"; + break; + case PokemonChoice::Bulbasaur: + cout << "Professor Oak: A fine choice! Bulbasaur is always ready to grow on you!\n"; + break; + case PokemonChoice::Squirtle: + cout << "Professor Oak: Splendid! Squirtle will keep you cool under pressure!\n"; + break; + default: + cout << "Professor Oak: Hmm, that doesn't seem right. Let me choose for you...\n"; + chosen_pokemon = PokemonChoice::Charmander; // Default to Charmander if invalid choice + cout << "Professor Oak: Just kidding! Let's go with Charmander, the fiery dragon in the making!\n"; + break; + } + + // Concluding the first chapter + cout << "Professor Oak: " << (chosen_pokemon == PokemonChoice::Charmander ? "Charmander" : chosen_pokemon == PokemonChoice::Bulbasaur ? "Bulbasaur" : "Squirtle") + << " and you, " << player_name << ", are going to be the best of friends!\n"; + cout << "Professor Oak: Your journey begins now! Get ready to explore the vast world of Pokemon!\n"; return 0; -} +} \ No newline at end of file From d818eab125db26016655e88ffa3243e2bb3ba12a Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Wed, 14 May 2025 11:05:51 +0530 Subject: [PATCH 02/10] first oop code --- Pokemon/main | Bin 0 -> 47864 bytes Pokemon/main.cpp | 194 +++++++++++++++++++++++++++++------------------ 2 files changed, 119 insertions(+), 75 deletions(-) create mode 100755 Pokemon/main diff --git a/Pokemon/main b/Pokemon/main new file mode 100755 index 0000000000000000000000000000000000000000..81aae235a636d58a3c29e78a97f8eea86ce67eb7 GIT binary patch literal 47864 zcmeHwe|%KcnfJLfK_>hbqXq~tfdElc%!B|*#WI+TfFNX(=*uE_nM`hyfyqpmnLzl_ z8aHaKKUzo8Qf1pj?HZK!Wn15E@~+mjXg~C$ZzYtqcGuPkvfWUBytMFkgA((8pL5Th z+4Fv(Xc;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cYgyJ4HR8a(sALb_u>{9&*yv zCdQGq09=lVm59&VFld#Ao#+S^jBSXnd6O0mKxOTN>lI!qIZa^_@z*gRdxo#WsmNtk!DVD#`l_)KQuW9MSb?`Ep&C1)#woz_V z*2^_a4z+3#0uSSXH7NT67cH013NE0lYi~g`N2fMUmTC#6w;)>bVB0k`M!EOM>%(py zyVtFaO3?a zl$zQShcF>Mmy|DglS~LJNBaUVL=B^B|KnBh9cJX7tG19 zs#13yTBpBY9>Z=mU6=*n$?#TJ)7#WRc~`E&y0ffO#$WGnJJCuVk)hB^j@A)F`ARR2 zIkcTvq+Fg7zKFv#$qfZX4&{fcaLH_WNeTY+f?V!+!CVzk@{>|rg-J;TDUuc?Q!P$T zDoRRPoSamY%&Ry>QgIS5SAH?RdSmR<-;e9U7k__3RQpCT18MYCsN^`0}%pIc;>mkZTsch~}62w<$L*|K8ZY{KK8wH=la+!Cn7Yy7R=nZ{PlO?{EL- zJ!f9}_||pv-c(+=>(QEy+9Ua&?REX+)va6lm+YB&`|oEQ`jaJ?LV;h!*!1zZJg9UJL5;KZGW@rqnCbg&w(GU3;p6`O;_4)y1Td7)~*{h zu>0lRJMaJ3S07&Sjl35!f4KS4(YJ4k|0=TOiBCU?ZcwJKUA_ONhS$G)VAQQQKhxwp zU;c}IURt{Ax9>mvaqVZ{oEkl;+_H1V>3ja^|L))X>hJ71|5PHqV|(>ij!*86+YkQX z@GD!NdTry;gGayl({SZiZ-2D6bn`onzw{nCb)WQrW82SO{iJ2**uKfXx23;X`M?kU zeOA+fbGFzw_Wbn884bUi_|C?)Q*W(#D^K~F&H3l5%13|j#`<44{k!Aao@f${@&5s; CCz{9r literal 0 HcmV?d00001 diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index d6f2079a..9062748f 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -1,89 +1,133 @@ -#include -#include +#include +#include using namespace std; // Define an enum for Pokemon choices enum class PokemonChoice { - Charmander, - Bulbasaur, - Squirtle, - InvalidChoice + CHARMANDER = 1, + BULBASAUR, + SQUIRTLE, + PIKACHU // Default choice }; -enum class PokemonType{ - Fire, - Electric, - Water, - Earth, - Normal +// Define an enum for Pokemon types +enum class PokemonType { + FIRE, + GRASS, + WATER, + ELECTRIC }; -int main() { - // Variables to store player name and chosen Pokemon - string player_name; - PokemonChoice chosen_pokemon = PokemonChoice::InvalidChoice; // Default to an invalid choice - - // Introduction by the Professor - cout << "Professor Oak: Hello there! Welcome to the world of Pokemon!\n"; - cout << "Professor Oak: My name is Oak. People call me the Pokemon Professor!\n"; - cout << "Professor Oak: But enough about me. Let's talk about you!\n"; - - // Taking player name as input - cout << "Professor Oak: First, tell me, what’s your name?\n"; - cin >> player_name; - - cout << "Professor Oak: Ah, " << player_name << "! What a fantastic name!\n"; - cout << "Professor Oak: You must be eager to start your adventure. But first, you’ll need a Pokemon of your own!\n"; - - // Presenting Pokemon choices - cout << "Professor Oak: I have three Pokemon here with me. They’re all quite feisty!\n"; - cout << "Professor Oak: Choose wisely...\n"; - cout << "1. Charmander - The fire type. A real hothead!\n"; - cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; - cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; - - int choice; - cout << "Professor Oak: So, which one will it be? Enter the number of your choice: "; - cin >> choice; - - // Map the integer choice to the corresponding enum value - switch(choice) { - case 1: - chosen_pokemon = PokemonChoice::Charmander; - break; - case 2: - chosen_pokemon = PokemonChoice::Bulbasaur; - break; - case 3: - chosen_pokemon = PokemonChoice::Squirtle; - break; - default: - chosen_pokemon = PokemonChoice::InvalidChoice; - break; +// Pokemon class definition +class Pokemon { + public: + // Attributes + string name; + PokemonType type; + int health; + + // Created 2 constructors + Pokemon(){ + + } + + Pokemon(string p_name, PokemonType p_type, int p_health){ + name = p_name; + type = p_type; + health = p_health; + } + + // Method to simulate attacking (just for demonstration) + void attack() { std::cout << name << "attacks with a powerful move!\n"; } +}; + +// Player class definition +class Player { +public: + // Attributes + string name; + Pokemon chosenPokemon; + + // Method to choose a Pokemon + void 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"; + } +}; + +// ProfessorOak class definition +class ProfessorOak { + // Attributes + public: + string name; + + // Method to greet the player + void greetPlayer(Player& player) { + cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; + cout << name << ": My name is Oak. People call me the Pokemon Professor!\n"; + cout << name << ": But enough about me. Let's talk about you!\n"; } - // Respond based on the chosen Pokemon - switch(chosen_pokemon) { - case PokemonChoice::Charmander: - cout << "Professor Oak: A fiery choice! Charmander is yours!\n"; - break; - case PokemonChoice::Bulbasaur: - cout << "Professor Oak: A fine choice! Bulbasaur is always ready to grow on you!\n"; - break; - case PokemonChoice::Squirtle: - cout << "Professor Oak: Splendid! Squirtle will keep you cool under pressure!\n"; - break; - default: - cout << "Professor Oak: Hmm, that doesn't seem right. Let me choose for you...\n"; - chosen_pokemon = PokemonChoice::Charmander; // Default to Charmander if invalid choice - cout << "Professor Oak: Just kidding! Let's go with Charmander, the fiery dragon in the making!\n"; - break; + // Method to ask the player to choose a Pokemon + void offerPokemonChoices(Player& player) { + cout << name << ": First, tell me, what’s your name?\n"; + getline(cin, player.name); + cout << name << ": Ah, " << player.name << "! What a fantastic name!\n"; + cout << name << ": You must be eager to start your adventure. But first, you’ll need a Pokemon of your own!\n"; + + // Presenting Pokemon choices + cout << name << ": I have three Pokemon here with me. They’re all quite feisty!\n"; + cout << name << ": Choose wisely...\n"; cout << "1. Charmander - The fire type. A real hothead!\n"; + cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; + cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; + + int choice; + cout << name << ": So, which one will it be? Enter the number of your choice: "; + cin >> choice; + player.choosePokemon(choice); } +}; + +int main() { + + // Creating Objects of ProfessorOak, Pokemon and Player class + ProfessorOak professor; + Pokemon placeholderPokemon; + Player player; - // Concluding the first chapter - cout << "Professor Oak: " << (chosen_pokemon == PokemonChoice::Charmander ? "Charmander" : chosen_pokemon == PokemonChoice::Bulbasaur ? "Bulbasaur" : "Squirtle") - << " and you, " << player_name << ", are going to be the best of friends!\n"; + //Assigning Values to placeholderPokemon attributes + placeholderPokemon.name = "Pikachu"; + placeholderPokemon.type = PokemonType::ELECTRIC; + placeholderPokemon.health = 40; + + //Assigning Values to player attributes + player.name = "Trainer"; + + //Assigning Values to ProfessorOak attributes + professor.name = "Professor Oak"; + + // Greet the player and offer Pokemon choices + professor.greetPlayer(player); + professor.offerPokemonChoices(player); + + // Conclude the first chapter + cout << "Professor Oak: " << player.chosenPokemon.name << " and you, " << player.name << ", are going to be the best of friends!\n"; cout << "Professor Oak: Your journey begins now! Get ready to explore the vast world of Pokemon!\n"; - return 0; -} \ No newline at end of file + +return 0; + +} From f790b13d1ace086b7a60e7ab800ea6294f0312a3 Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Wed, 14 May 2025 11:45:06 +0530 Subject: [PATCH 03/10] assignment --- Pokemon/mys.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Pokemon/mys.cpp diff --git a/Pokemon/mys.cpp b/Pokemon/mys.cpp new file mode 100644 index 00000000..7955dc0c --- /dev/null +++ b/Pokemon/mys.cpp @@ -0,0 +1,27 @@ +#include +#include // include for to_string +using namespace std; + +void castSpell(int magicLevel) +{ + cout << "Casting spell with magic level: " << to_string(magicLevel) << endl; +} + +void brewElixer(int &magicLevel){ + magicLevel += 10; + castSpell(magicLevel); +} + +void brewPotion(int magicLevel){ + magicLevel += 50; + castSpell(magicLevel); +} + +int main() +{ + int magicLevel = 30; + brewElixer(magicLevel); // Pass by reference: modifies original + brewPotion(magicLevel); // Pass by value: does not modify original + cout << magicLevel; + return 0; +} From 601c5a39cf7e6f4e942bd3815f1569b3ea7f6134 Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Thu, 15 May 2025 10:15:04 +0530 Subject: [PATCH 04/10] constructor --- Pokemon/main | Bin 47864 -> 46968 bytes Pokemon/main.cpp | 182 ++++++++++++++++++++++++++++++----------------- 2 files changed, 118 insertions(+), 64 deletions(-) diff --git a/Pokemon/main b/Pokemon/main index 81aae235a636d58a3c29e78a97f8eea86ce67eb7..339d6b82c079ef36bbbecbe7d724611b20dac802 100755 GIT binary patch delta 9492 zcmai43s_Xwwch82b3s==510KvX;ypng z+U6);!8vbHR(nq(I;zYwx{tG(Mvc0P0SSvD(6D^c9~szR+>OG@VQ zfVohDRaX+1$6OvOfpJTSpTYbLGH#`J6-_vmxv4A*;}($YWacMB)}6P~yO@M0GC7fj zVckp!2V8zx)wdxxOB)*G>eTi_;D_-xqy>3!8PMlhXJ|hJnTMIbYk?(M+9>e8vEl}{ z749DkOHMEGjw3@xvmvAJ7?S+Yl$_7f5=hAimLCBfd4=9&(viYk${ii|unu!X?c(M< zyO#|L?EiV^xNObz&nAJTIH8TcWLB808)~9ShA=ne&LrQ8f3lr0^zYz(gIIo$Zs@mW zaItPCWA7-r!b*H~VOk)HcV}xKGUvH$Xzv6+i`{;ZLqd3a2o86L5VWUTvC_c))fu#@P!b+0bJ?Kv z24Fb*j4UJ3K$L07Q7PHA5oY{Qd9!FJtJzoJUbG(@>6XGWyR`Z%+^7H>9pgwsCf z-jEJUqKr>)n5$@yu(=@88!XnCSd(b%1ioYt$4Kx6nPeI3=mtxn;6unn8}F8=3lohp zHzC7Fs$~7})P``Qv5DHgNJl*FUl#(-Q&;4t06R?cu>p=?XO}@e)`iZ15T<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mAZ(uG!c#(da z-tJb|#)2PM;X3m~yj0165phQimNJJiKh2!Z+`>$8O8U2$+dSF;c3(#Jr#RI&&AZZoJE%UEE|rm|Gy0VdP{Wo4JGeAhQp8 zPW4^PGng+j+nAlqmzec98EJr1&=G2HaxvDwgarw#@FKIB`3!S4^Bv|U<~TSagBO{% zG3#&ylfyqTKhK;BJ<`8Q4FBRI7MO5DQG>rRXEXm2iqxQ%ITSf@1M?zgy5Xq(G3Ja= zHxDwGGH*pr?R#-I*r~yvS#TW!;z`I!Ar@C9@ebzs%$JzAFwaI#`gFCDeiido=9ig` zxPYj>k2x~}@lS#&EOm{xj>rC$U z*->`4;4v1IM!ES2Gd&KdK@@UwcreDzcIF=DSDEp*9GCu8=3IPSC}=+we}SO(rOb~q z@3OPtFblevuQA_dHo`C&NQiSAEM}%x3px0J`7E;^+L6A9ch~1Jo0#`8+cQ}3TNdOp z$G{L7Xkvbf`7E=O`MO6RxxYpTdXiCxrZLmgjCejXJ<*6CbFVi3i+r^6UEfKuGaVb*^6u35N0F5!^U}zaGJ9 zFg?7zeFWoAX7|+lVYw*&@t^y*2!i2UH-bMH!FNWmzk8&2?M05@86$X+)*b(M8|)sT z@bU=m7{UKCfVX-Vdh05Y(med(*%c^Z_Dy^lKRpn(> z)z-4=1x2|QkA}+~`=>9Zz7JckpPZckd(~VM;n|4TRr1E6Sh?X?wTy3kK=vIUN9)oN()OGx z|9*UX$H}+Sm5$^$YZbZv#56T6UA}x`p?vsl&PJMv|E48|DWYHI%3%I}Uz$2%su@ts9lvZi^I}BB<$%u~Uov6t f>W`CbJ5 -#include +#include +#include using namespace std; // Define an enum for Pokemon choices @@ -15,30 +15,51 @@ enum class PokemonType { FIRE, GRASS, WATER, - ELECTRIC + ELECTRIC, + NORMAL // Added for the default constructor }; // Pokemon class definition class Pokemon { - public: +public: // Attributes string name; PokemonType type; int health; - // Created 2 constructors - Pokemon(){ - + // Default constructor + Pokemon() { + name = "Unknown"; + type = PokemonType::NORMAL; + health = 50; + cout << "A new Pokemon has been created with the default constructor!\n"; } - Pokemon(string p_name, PokemonType p_type, int p_health){ + // Parameterized constructor + Pokemon(string p_name, PokemonType p_type, int p_health) { name = p_name; type = p_type; health = p_health; + cout << "A new Pokemon named " << name << " has been created!\n"; + } + + // Copy constructor + Pokemon(const Pokemon &other) { + name = other.name; + type = other.type; + health = other.health; + cout << "A new Pokemon has been copied from " << other.name << "!\n"; + } + + // Destructor + ~Pokemon() { + cout << name << " has been released.\n"; } // Method to simulate attacking (just for demonstration) - void attack() { std::cout << name << "attacks with a powerful move!\n"; } + void attack() { + cout << name << " attacks with a powerful move!\n"; + } }; // Player class definition @@ -48,86 +69,119 @@ class Player { string name; Pokemon chosenPokemon; + // Default constructor + Player() { + name = "Trainer"; + chosenPokemon = Pokemon(); // Using the default Pokemon constructor + cout << "A new player named " << name << " has been created!\n"; + } + + // Parameterized constructor + Player(std::string p_name, Pokemon p_chosenPokemon) { + name = p_name; + chosenPokemon = p_chosenPokemon; + cout << "Player " << name << " has been created!\n"; + } + // Method to choose a Pokemon void choosePokemon(int choice) { - switch ((PokemonChoice)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"; + 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"; } }; // ProfessorOak class definition class ProfessorOak { +public: // Attributes - public: string name; + // Parameterized constructor + ProfessorOak(string p_name) { + name = p_name; + } + // Method to greet the player void greetPlayer(Player& player) { - cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; - cout << name << ": My name is Oak. People call me the Pokemon Professor!\n"; + cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; + cout << name << ": My name is Oak. People call me the Pokemon Professor!\n"; cout << name << ": But enough about me. Let's talk about you!\n"; } // Method to ask the player to choose a Pokemon void offerPokemonChoices(Player& player) { - cout << name << ": First, tell me, what’s your name?\n"; - getline(cin, player.name); + cout << name << ": First, tell me, what’s your name?\n"; + getline(std::cin, player.name); cout << name << ": Ah, " << player.name << "! What a fantastic name!\n"; - cout << name << ": You must be eager to start your adventure. But first, you’ll need a Pokemon of your own!\n"; + cout << name << ": You must be eager to start your adventure. But first, you’ll need a Pokemon of your own!\n"; - // Presenting Pokemon choices - cout << name << ": I have three Pokemon here with me. They’re all quite feisty!\n"; - cout << name << ": Choose wisely...\n"; cout << "1. Charmander - The fire type. A real hothead!\n"; - cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; - cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; + // Presenting Pokemon choices + cout << name << ": I have three Pokemon here with me. They’re all quite feisty!\n"; + cout << name << ": Choose wisely...\n"; + cout << "1. Charmander - The fire type. A real hothead!\n"; + cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; + cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; + + int choice; + cout << name << ": So, which one will it be? Enter the number of your choice: "; + cin >> choice; - int choice; - cout << name << ": So, which one will it be? Enter the number of your choice: "; - cin >> choice; player.choosePokemon(choice); } }; int main() { - - // Creating Objects of ProfessorOak, Pokemon and Player class - ProfessorOak professor; - Pokemon placeholderPokemon; - Player player; - - //Assigning Values to placeholderPokemon attributes - placeholderPokemon.name = "Pikachu"; - placeholderPokemon.type = PokemonType::ELECTRIC; - placeholderPokemon.health = 40; - - //Assigning Values to player attributes - player.name = "Trainer"; - - //Assigning Values to ProfessorOak attributes - professor.name = "Professor Oak"; - - // Greet the player and offer Pokemon choices - professor.greetPlayer(player); - professor.offerPokemonChoices(player); - - // Conclude the first chapter - cout << "Professor Oak: " << player.chosenPokemon.name << " and you, " << player.name << ", are going to be the best of friends!\n"; + // Task 1: Test default and parameterized constructors + Pokemon defaultPokemon; // Using default constructor + Pokemon charmander("Charmander", PokemonType::FIRE, 100); // Using parameterized constructor + + cout << "Pokemon Details:\n"; + cout << "Name: " << defaultPokemon.name << "\nType: " << (int)defaultPokemon.type << "\nHealth: " << defaultPokemon.health << "\n"; + cout << "Name: " << charmander.name << "\nType: " << (int)charmander.type << "\nHealth: " << charmander.health << "\n"; + + // Task 2: Test the copy constructor + Pokemon bulbasaur("Bulbasaur", PokemonType::GRASS, 100); // Create a Pokemon + Pokemon bulbasaurCopy = bulbasaur; // Copy the Pokemon + cout << "Original Pokemon Health: " << bulbasaur.health << "\n"; + cout << "Copied Pokemon Health: " << bulbasaurCopy.health << "\n"; + + // Modify the copy + bulbasaurCopy.health = 80; + cout << "After Modification:\n"; + cout << "Original Pokemon Health: " << bulbasaur.health << "\n"; + cout << "Copied Pokemon Health: " << bulbasaurCopy.health << "\n"; + + // Task 3: Test the destructor + { + Pokemon squirtle("Squirtle", PokemonType::WATER, 100); // Pokemon will be destroyed at the end of this scope + } // Destructor will be called here + + // Continue with the main flow of the game + ProfessorOak professor("Professor Oak"); + Player player("Ash", charmander); + + // Greet the player and offer Pokemon choices + professor.greetPlayer(player); + professor.offerPokemonChoices(player); + + // Conclude the first chapter + cout << "Professor Oak: " << player.chosenPokemon.name << " and you, " << player.name << ", are going to be the best of friends!\n"; cout << "Professor Oak: Your journey begins now! Get ready to explore the vast world of Pokemon!\n"; - -return 0; - -} + return 0; +} \ No newline at end of file From 1305020667aaed92957cb9ff7fb2d3f13a190608 Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Thu, 15 May 2025 10:41:00 +0530 Subject: [PATCH 05/10] assignment --- Pokemon/main | Bin 46968 -> 46968 bytes Pokemon/main.cpp | 14 +++++++++++--- Pokemon/scroll.cpp | 8 ++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Pokemon/scroll.cpp diff --git a/Pokemon/main b/Pokemon/main index 339d6b82c079ef36bbbecbe7d724611b20dac802..0124df526935b719ea3dbe227f4d931ede86c656 100755 GIT binary patch delta 253 zcmVa2`NCC4R5A6p8upwYPlMfe~0noFm7j72^P-$yn zV`z1=A1@UHvph1&4Uu37vj#xxb$>G_)pCea8<}oavKMpoQ%+}AWv}o39|8e?S$#O1 zbDH^c7v`EUfE3)Y>k*oiHJHN>`PXJi`hte?RjZ-EJA|0Rz2CiC2Iw53fu5BX9zX;4 z3&K!^8vL|0B%l=u-l+O>r@T(z0YS-OQz_5D^*o^YT6y(Q*s#hsd~rwKtO4n>akd8m D1RQE! delta 258 zcmV+d0sa2??gIGk0a2`NCvYW5A6p8&>_$WlMfe~0r0b`7j72^Rc>o; zZ+C99A1@UH2T*BiVPj}@vokWw4YLM7>vexkdP>XFFvMO5o>&QO5IMvn5oujezj*LL zqY`}t8G_q_76+Zx39%I5z-C>xyHPUccrCSlaiz=@;P{fngSORpu687TX+<#?X!{ly z^AWhQ0;zi=M^)%`cYrzN;aLr32pQS*+jb(p1o)@;+y)TUKL3ApJ)vt_y;G*uL)HNZ IvvIZu0W~CNG5`Po diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index a5d7a6c5..9050fe20 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -29,9 +29,9 @@ class Pokemon { // Default constructor Pokemon() { - name = "Unknown"; - type = PokemonType::NORMAL; - health = 50; + name = "Pikachu"; + type = PokemonType::ELECTRIC; + health = 10; cout << "A new Pokemon has been created with the default constructor!\n"; } @@ -56,6 +56,8 @@ class Pokemon { cout << name << " has been released.\n"; } + + // Method to simulate attacking (just for demonstration) void attack() { cout << name << " attacks with a powerful move!\n"; @@ -83,6 +85,12 @@ class Player { cout << "Player " << name << " has been created!\n"; } + Player(const Player& other){ + name = other.name; + chosenPokemon = other.chosenPokemon; + cout << "Player " << name << " Has been coppied"; + } + // Method to choose a Pokemon void choosePokemon(int choice) { switch ((PokemonChoice)choice) { diff --git a/Pokemon/scroll.cpp b/Pokemon/scroll.cpp new file mode 100644 index 00000000..52b45a95 --- /dev/null +++ b/Pokemon/scroll.cpp @@ -0,0 +1,8 @@ +#include +using namespace std; + + + +int main(){ + +} \ No newline at end of file From 6cef2e18edd439a59790aefd9cd0796a2a1c9419 Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Thu, 15 May 2025 14:59:20 +0530 Subject: [PATCH 06/10] fixed dailog --- Pokemon/main | Bin 46968 -> 47256 bytes Pokemon/main.cpp | 421 ++++++++++++++++++++++++++++----------------- Pokemon/naim | Bin 0 -> 46952 bytes Pokemon/scroll | Bin 0 -> 39848 bytes Pokemon/scroll.cpp | 12 +- 5 files changed, 278 insertions(+), 155 deletions(-) create mode 100755 Pokemon/naim create mode 100755 Pokemon/scroll diff --git a/Pokemon/main b/Pokemon/main index 0124df526935b719ea3dbe227f4d931ede86c656..38440088120dcf0a57b9ae611f042d1d1583e034 100755 GIT binary patch literal 47256 zcmeHw4|r77weLPN155%+fGD5{CyEd?#!M1Iq9}u5gb2l$M2i$XP9`UrF_W1vGa*E{ zZ8Z2_E2C*eOWPo5gSD3ST1$HEXDr@cd-Yz4+FS3f?MuLW8gdpdIF;LKsgj8rf!PSlXhA8 z4MKL}CtskY6HV<(Tn^Trc*cXGL}M+r(L|J$pEFnEw_Y@oXd^$T;0Fx(r6>(PpQ3K^ zsm(DZ=B>5ztGh_!*DUxEZRD2_B*D)YjYR^Xh6HWK@9m2(*3jz3bNaFx>fNx!Vy*fvU+u z0B&JJw}MX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!EX}Cy7@0SHgCA1b zTj6W)Z{CNcraxY3sfP1oF!`fG?ds z0Ydv0D;qfa`s+8$f{&yu{L{B}$X_iA;S0D|JM0#Q_(GoR&I&5^Q}@|3|94<}?UcXq z-Sy*%!Ov<}Hr=KC=nv;|Ez-B{d8ll6@Y&PBiNAfes3ZHG{U2WO?9Ms6dMBLzW#jTQ zk39B&?)<@?0}Hn8dh_-7UcYzDz|`j-{@(w%X1c@r$FXl#KRWsBE2a67tJB}@Ium^9 zwUzHli{5h8-thK;&nqIQ*KGN``q=(|o%i6zrSI-Lne%t|Kb7{4`=b9I-0)Xteji$^ zOkP#BcR}mH@9j&y{nqE&-9P-+z8|ml|LkPrfs|kN^=+`MTAe!d;42S4@aTWO{=~9x z7ru0<`E5U6IQZ$UHRH-(|76!t+l-Ir{Pm65%~OtjdGg*+_2D;n*{A1UmA`b%YVVF$ zpSt4q9e=vz;0M2!);?bN&2R2_V(jNve{tsB$De#LFYx=)mwxur4?nPNdh|DIl*QAo z*)TS8@9~$Xu9<%P-hEqgKRNo*$I +#include // Include this header to use numeric_limits #include using namespace std; +// Function to clear the console +void clearConsole() { +// Platform-specific clear console command +#ifdef _WIN32 + system("cls"); +#else + (void)system("clear"); +#endif +} + +// Function to wait for user to press Enter +void waitForEnter() { + cin.get(); // Wait for Enter key +} + // Define an enum for Pokemon choices enum class PokemonChoice { - CHARMANDER = 1, - BULBASAUR, - SQUIRTLE, - PIKACHU // Default choice + CHARMANDER = 1, + BULBASAUR, + SQUIRTLE, + PIKACHU // Default choice }; // Define an enum for Pokemon types enum class PokemonType { - FIRE, - GRASS, - WATER, - ELECTRIC, - NORMAL // Added for the default constructor + FIRE, + GRASS, + WATER, + ELECTRIC, + NORMAL // Added for the default constructor }; // Pokemon class definition class Pokemon { public: - // Attributes - string name; - PokemonType type; - int health; - - // Default constructor - Pokemon() { - name = "Pikachu"; - type = PokemonType::ELECTRIC; - health = 10; - cout << "A new Pokemon has been created with the default constructor!\n"; - } + string name; + PokemonType type; + int health; - // Parameterized constructor - Pokemon(string p_name, PokemonType p_type, int p_health) { - name = p_name; - type = p_type; - health = p_health; - cout << "A new Pokemon named " << name << " has been created!\n"; - } + // Default constructor + Pokemon() { + name = "Unknown"; + type = PokemonType::NORMAL; + health = 50; + } - // Copy constructor - Pokemon(const Pokemon &other) { - name = other.name; - type = other.type; - health = other.health; - cout << "A new Pokemon has been copied from " << other.name << "!\n"; - } + // Parameterized constructor + Pokemon(std::string p_name, PokemonType p_type, int p_health) { + name = p_name; + type = p_type; + health = p_health; + } - // Destructor - ~Pokemon() { - cout << name << " has been released.\n"; - } + // Copy constructor + Pokemon(const Pokemon &other) { + name = other.name; + type = other.type; + health = other.health; + } - + // Destructor + ~Pokemon() { + // Destructor message removed + } - // Method to simulate attacking (just for demonstration) - void attack() { - cout << name << " attacks with a powerful move!\n"; - } + void attack() { std::cout << name << " attacks with a powerful move!\n"; } }; // Player class definition class Player { public: - // Attributes - string name; - Pokemon chosenPokemon; - - // Default constructor - Player() { - name = "Trainer"; - chosenPokemon = Pokemon(); // Using the default Pokemon constructor - cout << "A new player named " << name << " has been created!\n"; - } + string name; + Pokemon chosenPokemon; - // Parameterized constructor - Player(std::string p_name, Pokemon p_chosenPokemon) { - name = p_name; - chosenPokemon = p_chosenPokemon; - cout << "Player " << name << " has been created!\n"; - } + // Default constructor + Player() { + name = "Trainer"; + chosenPokemon = Pokemon(); // Using the default Pokemon constructor + } - Player(const Player& other){ - name = other.name; - chosenPokemon = other.chosenPokemon; - cout << "Player " << name << " Has been coppied"; - } + // Parameterized constructor + Player(std::string p_name, Pokemon p_chosenPokemon) { + name = p_name; + chosenPokemon = p_chosenPokemon; + } - // Method to choose a Pokemon - void 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"; + void 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"; + waitForEnter(); // Wait for user to press Enter before proceeding + } }; // ProfessorOak class definition class ProfessorOak { public: - // Attributes - string name; + string name; - // Parameterized constructor - ProfessorOak(string p_name) { - name = p_name; - } + // Parameterized constructor + ProfessorOak(string p_name) { name = p_name; } - // Method to greet the player - void greetPlayer(Player& player) { - cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; - cout << name << ": My name is Oak. People call me the Pokemon Professor!\n"; - cout << name << ": But enough about me. Let's talk about you!\n"; - } + void greetPlayer(Player &player) { + cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; + waitForEnter(); + cout << name + << ": My name is Oak. People call me the Pokemon Professor!\n"; + waitForEnter(); + cout << name << ": But enough about me. Let's talk about you!\n"; + waitForEnter(); + } - // Method to ask the player to choose a Pokemon - void offerPokemonChoices(Player& player) { - cout << name << ": First, tell me, what’s your name?\n"; - getline(std::cin, player.name); - cout << name << ": Ah, " << player.name << "! What a fantastic name!\n"; - cout << name << ": You must be eager to start your adventure. But first, you’ll need a Pokemon of your own!\n"; - - // Presenting Pokemon choices - cout << name << ": I have three Pokemon here with me. They’re all quite feisty!\n"; - cout << name << ": Choose wisely...\n"; - cout << "1. Charmander - The fire type. A real hothead!\n"; - cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; - cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; - - int choice; - cout << name << ": So, which one will it be? Enter the number of your choice: "; - cin >> choice; - - player.choosePokemon(choice); - } + void offerPokemonChoices(Player &player) { + cout + << name + << ": First, tell me, what’s your name? \t [Please Enter Your Name]\n"; + getline(std::cin, player.name); + cout << name << ": Ah, " << player.name + << "! What a fantastic name!\n"; + waitForEnter(); + cout << name + << ": You must be eager to start your adventure. But first, " + "you’ll need a Pokemon of your own!\n"; + waitForEnter(); + + // Presenting Pokemon choices + cout + << name + << ": I have three Pokemon here with me. They’re all quite feisty!\n"; + waitForEnter(); + cout << name << ": Choose wisely...\n"; + cout << "1. Charmander - The fire type. A real hothead!\n"; + cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; + cout << "3. Squirtle - The water type. Cool as a cucumber!\n"; + + int choice; + cout + << name + << ": So, which one will it be? Enter the number of your choice: "; + cin >> choice; + + player.choosePokemon(choice); + waitForEnter(); + } + + // New method for the main quest conversation + void explainMainQuest(Player &player) { + // Clear the console + clearConsole(); + + cout << "Professor Oak: " << player.name + << "!, I am about to explain you about your upcoming grand " + "adventure.\n"; + waitForEnter(); + cout << "Professor Oak: You see, becoming a Pokémon Master is no easy " + "feat. It takes courage, wisdom, and a bit of luck!\n"; + waitForEnter(); + cout + << "Professor Oak: Your mission, should you choose to accept it—and " + "trust me, you really don’t have a choice—is to collect all the " + "Pokémon Badges and conquer the Pokémon League.\n"; + waitForEnter(); + + cout << "\n" + << player.name + << ": Wait... that sounds a lot like every other Pokémon game " + "out there...\n"; + waitForEnter(); + cout << "Professor Oak: Shhh! Don't break the fourth wall, " + << player.name << "! This is serious business!\n"; + waitForEnter(); + + cout << "\nProfessor Oak: To achieve this, you’ll need to battle wild " + "Pokémon, challenge gym leaders, and of course, keep your " + "Pokémon healthy at the PokeCenter.\n"; + waitForEnter(); + cout << "Professor Oak: Along the way, you'll capture new Pokémon to " + "strengthen your team. Just remember—there’s a limit to how " + "many Pokémon you can carry, so choose wisely!\n"; + waitForEnter(); + + cout << "\n" + << player.name << ": Sounds like a walk in the park... right?\n"; + waitForEnter(); + cout << "Professor Oak: Hah! That’s what they all say! But beware, " + "young Trainer, the path to victory is fraught with " + "challenges. And if you lose a battle... well, let’s just say " + "you'll be starting from square one.\n"; + waitForEnter(); + + cout << "\nProfessor Oak: So, what do you say? Are you ready to " + "become the next Pokémon Champion?\n"; + waitForEnter(); + cout << "\n" << player.name << ": Ready as I’ll ever be, Professor!\n"; + waitForEnter(); + + cout + << "\nProfessor Oak: That’s the spirit! Now, your journey begins...\n"; + waitForEnter(); + cout << "Professor Oak: But first... let's just pretend I didn't " + "forget to set up the actual game loop... Ahem, onwards!\n"; + waitForEnter(); + } }; +// Function to handle the main game loop +void gameLoop(Player &player) { + int choice; + bool keepPlaying = true; + + while (keepPlaying) { + // Clear console before showing options + clearConsole(); + + // Display options to the player + cout << "\nWhat would you like to do next, " << player.name << "?\n"; + cout << "1. Battle Wild Pokémon\n"; + cout << "2. Visit PokeCenter\n"; + cout << "3. Challenge Gyms\n"; + cout << "4. Enter Pokémon League\n"; + cout << "5. Quit\n"; + cout << "Enter your choice: "; + cin >> choice; + + // Clear the newline character left in the buffer after cin >> choice + cin.ignore(numeric_limits::max(), '\n'); + + + // Process the player's choice and display the corresponding message + switch (choice) { + case 1: + cout << "You look around... but all the wild Pokémon are on " + "vacation. Maybe try again later?\n"; + break; + case 2: + cout + << "You head to the PokeCenter, but Nurse Joy is out on a coffee " + "break. Guess your Pokémon will have to tough it out for now!\n"; + break; + case 3: + cout << "You march up to the Gym, but it's closed for renovations. " + "Seems like even Gym Leaders need a break!\n"; + break; + case 4: + cout << "You boldly step towards the Pokémon League... but the " + "gatekeeper laughs and says, 'Maybe next time, champ!'\n"; + break; + case 5: + cout << "You try to quit, but Professor Oak's voice echoes: " + "'There's no quitting in Pokémon training!'\n"; + cout << "Are you sure you want to quit? (y/n): "; + char quitChoice; + cin >> quitChoice; + if (quitChoice == 'y' || quitChoice == 'Y') { + keepPlaying = false; + } + break; + default: + cout << "That's not a valid choice. Try again!\n"; + break; + } + + // Wait for Enter key before the screen is cleared and the menu is shown + // again + waitForEnter(); + } + + cout << "Goodbye, " << player.name << "! Thanks for playing!\n"; +} + int main() { - // Task 1: Test default and parameterized constructors - Pokemon defaultPokemon; // Using default constructor - Pokemon charmander("Charmander", PokemonType::FIRE, 100); // Using parameterized constructor - - cout << "Pokemon Details:\n"; - cout << "Name: " << defaultPokemon.name << "\nType: " << (int)defaultPokemon.type << "\nHealth: " << defaultPokemon.health << "\n"; - cout << "Name: " << charmander.name << "\nType: " << (int)charmander.type << "\nHealth: " << charmander.health << "\n"; - - // Task 2: Test the copy constructor - Pokemon bulbasaur("Bulbasaur", PokemonType::GRASS, 100); // Create a Pokemon - Pokemon bulbasaurCopy = bulbasaur; // Copy the Pokemon - cout << "Original Pokemon Health: " << bulbasaur.health << "\n"; - cout << "Copied Pokemon Health: " << bulbasaurCopy.health << "\n"; - - // Modify the copy - bulbasaurCopy.health = 80; - cout << "After Modification:\n"; - cout << "Original Pokemon Health: " << bulbasaur.health << "\n"; - cout << "Copied Pokemon Health: " << bulbasaurCopy.health << "\n"; - - // Task 3: Test the destructor - { - Pokemon squirtle("Squirtle", PokemonType::WATER, 100); // Pokemon will be destroyed at the end of this scope - } // Destructor will be called here - - // Continue with the main flow of the game - ProfessorOak professor("Professor Oak"); - Player player("Ash", charmander); - - // Greet the player and offer Pokemon choices - professor.greetPlayer(player); - professor.offerPokemonChoices(player); - - // Conclude the first chapter - cout << "Professor Oak: " << player.chosenPokemon.name << " and you, " << player.name << ", are going to be the best of friends!\n"; - cout << "Professor Oak: Your journey begins now! Get ready to explore the vast world of Pokemon!\n"; - - return 0; + // Create Pokemon and Player objects for the game + Pokemon charmander("Charmander", PokemonType::FIRE, + 100); // Using parameterized constructor + + // Continue with the main flow of the game + ProfessorOak professor("Professor Oak"); + Player player("Ash", charmander); + + // Greet the player and offer Pokemon choices + professor.greetPlayer(player); + professor.offerPokemonChoices(player); + + // Explain the main quest + professor.explainMainQuest(player); + + // Start the main game loop + gameLoop(player); + + return 0; } \ No newline at end of file diff --git a/Pokemon/naim b/Pokemon/naim new file mode 100755 index 0000000000000000000000000000000000000000..1a73a37ffa27607e13f83c0522ee897914cbbee3 GIT binary patch literal 46952 zcmeHw4|Eh&n(wXd209Q0B}znuilRh`m<|CFWroHOA&QVmG7h6)+3BvN+w`B%-2ozu z8#g-Re`$v^vNNm(b;jVJ%ed;2U1p67I}cf(L!5aIXUCZd=sPEjqYqd2y~H7#_xo<$ z>aMEp1O$9<_nfN3P1Se*eD}M*``zz;_f~QHmtTDRANh<)43`7pLWC|CV-Iu`Q53rb zVFiMs)Gl3KeS3A?YKk>qys$Yciy}TpkWo<@s@F7_lX-csIgSZ>9HR9=ITR(SZc5UV zc3JriKz8C+ez}%TG_@;zxmZW~84rq*NVYX5(ot4^Gv;XgmWf6ZZRF<`{D2|96s6hk zSJX{@wKb_EeT`OrcNJ^=S_MC%jr`Jrr1|+1$#^K*oTknA9ll!Q_oQ3PK(z6)@>Z0# z=*CbqpoF4LF=VvL7bw&C9TxHtZRKI)PyM=`^I5jEVX0EJdR4vFyIzeC!<}E2yAzQV zsG2DVz%6FzR?xZm4I(eUyjpodvGI7gR3~uH=6?!y*@Gx`Kmd0^YX+c*^94Qd0ApTcBy0*1y1&QRleq6mG1hwpW0UY)i$K?U5vYsW5lFVt zu7g_{yFN$a`G}JdNYAcoOT@1WhZ?U7w1)$r>7uri9ETSCeC^2U#U1;GF8T1^8-I{O z_wjOCn^01a^muymL~p2HTE0 zy+g+)dwaS*V11qW9d(-#hx7u<`?Q;F>vuX*Jb!pjs##C_K*}07IN+3C z?5>*5vAPrdp(h2#_#z8UZErw6=%p!NfrW+=nbP~w=G*o5quo{Dk(CFsmx#8I{N?Fq z)_032+tqpd;1rY{+0XihH#>F>cd}Gh=d8h_lh{yKr!v?-fejs<wweo;sDyH%ldj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7o#I*tH{R< z4R(Bfadc4+SL|Gju=f4Tnb%OC&cPak>lm96o= z|FHE$&cB>Fv(vR@>x_y0NB2Mc*l+*li4ET>`SF$V-}vD@!)Na using namespace std; - +void waitForEnter(){ + cin.get(); +} int main(){ + cout << "Hello , I am Professor Oak." << endl; + waitForEnter(); + cout << "I want to take rest." << endl; + waitForEnter(); + cout << "I have to Enjoy this winter." << endl; + waitForEnter() + cout << "I want to eat Pizza." << endl; + return 0; } \ No newline at end of file From e37331faba37163378a75780255f8a722f125a3a Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Thu, 15 May 2025 15:14:47 +0530 Subject: [PATCH 07/10] submission --- Pokemon/main.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index 20d38e59..b2d190f4 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -15,6 +15,7 @@ void clearConsole() { // Function to wait for user to press Enter void waitForEnter() { + cout << "please press enter to continue....!"; cin.get(); // Wait for Enter key } @@ -218,6 +219,50 @@ class ProfessorOak { "forget to set up the actual game loop... Ahem, onwards!\n"; waitForEnter(); } + + explainMainQuest(Player& player){ + + cout << "Professor Oak: \"Ah, " << player.player_name << ", let me tell you about your grand adventure that's about to unfold!\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"Becoming a Pokémon Master is no easy task. It demands courage, strategy, and sometimes a little bit of luck.\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"Your main mission is to collect all the Pokémon Badges and defeat the Pokémon League. Only then can you challenge the Elite Four and aim for the title of Champion.\"" << endl; + waitForEnter(); + clearConsole(); + cout << player.player_name << ": \"Wait, isn’t that just like every other Pokémon game?\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"No breaking the fourth wall, " << player.player_name << "! This is serious business.\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"To achieve this, you must capture new Pokémon, battle wild creatures, challenge gym leaders, and keep your Pokémon healthy at the PokeCenter.\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"Remember, you can only carry a limited number of Pokémon. Choose wisely who you want on your team!\"" << endl; + waitForEnter(); + clearConsole(); + cout << player.player_name << ": \"Piece of cake, right?\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"Ha! That’s what everyone thinks. But the path to becoming a Champion is filled with obstacles. Lose a battle, and it’s back to the start!\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"So, what do you say? Are you ready to embark on this epic journey to become the next Pokémon Champion?\"" << endl; + waitForEnter(); + clearConsole(); + cout << player.player_name << ": \"Ready as I’ll ever be, Professor!\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"That’s the spirit! Now, your journey begins. Remember, it’s not just about battling—it’s about forming bonds with your Pokémon. Go, Trainer, the world of Pokémon awaits you!\"" << endl; + waitForEnter(); + clearConsole(); + cout << "Professor Oak: \"Oh, and about the actual game loop… let’s just pretend I didn’t forget to set it up. Onwards!\"" << endl; + waitForEnter(); + clearConsole(); + } + }; // Function to handle the main game loop From 598b53866a382686b60a107f09124c965b733a54 Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Sun, 25 May 2025 10:11:33 +0530 Subject: [PATCH 08/10] header file --- Pokemon/header.hpp | 1 + Pokemon/main.cpp | 50 +++------------------------------------------- 2 files changed, 4 insertions(+), 47 deletions(-) create mode 100644 Pokemon/header.hpp diff --git a/Pokemon/header.hpp b/Pokemon/header.hpp new file mode 100644 index 00000000..ff30235f --- /dev/null +++ b/Pokemon/header.hpp @@ -0,0 +1 @@ +} \ No newline at end of file diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index b2d190f4..dd484635 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -1,6 +1,6 @@ #include -#include // Include this header to use numeric_limits #include +#include using namespace std; // Function to clear the console @@ -15,7 +15,6 @@ void clearConsole() { // Function to wait for user to press Enter void waitForEnter() { - cout << "please press enter to continue....!"; cin.get(); // Wait for Enter key } @@ -219,50 +218,6 @@ class ProfessorOak { "forget to set up the actual game loop... Ahem, onwards!\n"; waitForEnter(); } - - explainMainQuest(Player& player){ - - cout << "Professor Oak: \"Ah, " << player.player_name << ", let me tell you about your grand adventure that's about to unfold!\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"Becoming a Pokémon Master is no easy task. It demands courage, strategy, and sometimes a little bit of luck.\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"Your main mission is to collect all the Pokémon Badges and defeat the Pokémon League. Only then can you challenge the Elite Four and aim for the title of Champion.\"" << endl; - waitForEnter(); - clearConsole(); - cout << player.player_name << ": \"Wait, isn’t that just like every other Pokémon game?\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"No breaking the fourth wall, " << player.player_name << "! This is serious business.\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"To achieve this, you must capture new Pokémon, battle wild creatures, challenge gym leaders, and keep your Pokémon healthy at the PokeCenter.\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"Remember, you can only carry a limited number of Pokémon. Choose wisely who you want on your team!\"" << endl; - waitForEnter(); - clearConsole(); - cout << player.player_name << ": \"Piece of cake, right?\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"Ha! That’s what everyone thinks. But the path to becoming a Champion is filled with obstacles. Lose a battle, and it’s back to the start!\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"So, what do you say? Are you ready to embark on this epic journey to become the next Pokémon Champion?\"" << endl; - waitForEnter(); - clearConsole(); - cout << player.player_name << ": \"Ready as I’ll ever be, Professor!\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"That’s the spirit! Now, your journey begins. Remember, it’s not just about battling—it’s about forming bonds with your Pokémon. Go, Trainer, the world of Pokémon awaits you!\"" << endl; - waitForEnter(); - clearConsole(); - cout << "Professor Oak: \"Oh, and about the actual game loop… let’s just pretend I didn’t forget to set it up. Onwards!\"" << endl; - waitForEnter(); - clearConsole(); - } - }; // Function to handle the main game loop @@ -350,4 +305,5 @@ int main() { gameLoop(player); return 0; -} \ No newline at end of file +} + \ No newline at end of file From 2d2c1f751eb123bbb950d53d4a3a7c9e6d59b17f Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Sun, 25 May 2025 10:20:28 +0530 Subject: [PATCH 09/10] code organization --- Pokemon/PokemonChoice.hpp | 7 +++++++ Pokemon/PokemonType.hpp | 8 ++++++++ Pokemon/header.hpp | 1 - Pokemon/main.cpp | 20 ++++---------------- 4 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 Pokemon/PokemonChoice.hpp create mode 100644 Pokemon/PokemonType.hpp delete mode 100644 Pokemon/header.hpp diff --git a/Pokemon/PokemonChoice.hpp b/Pokemon/PokemonChoice.hpp new file mode 100644 index 00000000..5bbc81d6 --- /dev/null +++ b/Pokemon/PokemonChoice.hpp @@ -0,0 +1,7 @@ +// Define an enum for Pokemon choices +enum class PokemonChoice { + CHARMANDER = 1, + BULBASAUR, + SQUIRTLE, + PIKACHU // Default choice + }; \ No newline at end of file diff --git a/Pokemon/PokemonType.hpp b/Pokemon/PokemonType.hpp new file mode 100644 index 00000000..1de288ba --- /dev/null +++ b/Pokemon/PokemonType.hpp @@ -0,0 +1,8 @@ +// Define an enum for Pokemon types +enum class PokemonType { + FIRE, + GRASS, + WATER, + ELECTRIC, + NORMAL // Added for the default constructor + }; \ No newline at end of file diff --git a/Pokemon/header.hpp b/Pokemon/header.hpp deleted file mode 100644 index ff30235f..00000000 --- a/Pokemon/header.hpp +++ /dev/null @@ -1 +0,0 @@ -} \ No newline at end of file diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index dd484635..55700ea3 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -1,6 +1,7 @@ #include #include -#include +#include "PokemonType.hpp" +#include "PokemonChoice.hpp" using namespace std; // Function to clear the console @@ -18,22 +19,9 @@ void waitForEnter() { cin.get(); // Wait for Enter key } -// Define an enum for Pokemon choices -enum class PokemonChoice { - CHARMANDER = 1, - BULBASAUR, - SQUIRTLE, - PIKACHU // Default choice -}; -// Define an enum for Pokemon types -enum class PokemonType { - FIRE, - GRASS, - WATER, - ELECTRIC, - NORMAL // Added for the default constructor -}; + + // Pokemon class definition class Pokemon { From 0f822448018253d39f5ffe388a5c80a55b62a0ca Mon Sep 17 00:00:00 2001 From: Mayur Mansing Nangare <163443687+nangareSama@users.noreply.github.com> Date: Sun, 25 May 2025 10:39:51 +0530 Subject: [PATCH 10/10] created a Utility class --- Pokemon/Utility.cpp | 20 +++++++++++++ Pokemon/Utility.hpp | 6 ++++ Pokemon/main.cpp | 69 +++++++++++++++++---------------------------- 3 files changed, 52 insertions(+), 43 deletions(-) create mode 100644 Pokemon/Utility.cpp create mode 100644 Pokemon/Utility.hpp diff --git a/Pokemon/Utility.cpp b/Pokemon/Utility.cpp new file mode 100644 index 00000000..690e7104 --- /dev/null +++ b/Pokemon/Utility.cpp @@ -0,0 +1,20 @@ +#include "Utility.hpp" +#include + +using namespace std; + +void Utility::clearConsole(){ + #ifdef _WIN32 + system("cls"); +#else + system("clear"); +#endif +} + +void Utility::waitForEnter(){ + cin.get(); +} + +void Utility :: clearInputBuffer() { + cin.ignore(numeric_limits::max(), '\n'); +} \ No newline at end of file diff --git a/Pokemon/Utility.hpp b/Pokemon/Utility.hpp new file mode 100644 index 00000000..158af473 --- /dev/null +++ b/Pokemon/Utility.hpp @@ -0,0 +1,6 @@ +class Utility{ + public : + static void clearConsole(); + static void waitForEnter(); + static void clearInputBuffer(); // New helper function +} \ No newline at end of file diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index 55700ea3..72c6e107 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -2,26 +2,9 @@ #include #include "PokemonType.hpp" #include "PokemonChoice.hpp" -using namespace std; - -// Function to clear the console -void clearConsole() { -// Platform-specific clear console command -#ifdef _WIN32 - system("cls"); -#else - (void)system("clear"); -#endif -} - -// Function to wait for user to press Enter -void waitForEnter() { - cin.get(); // Wait for Enter key -} - - - +#include "Utility.hpp" +using namespace std; // Pokemon class definition class Pokemon { @@ -93,7 +76,7 @@ class Player { break; } cout << "Player " << name << " chose " << chosenPokemon.name << "!\n"; - waitForEnter(); // Wait for user to press Enter before proceeding + Utility::waitForEnter(); // Wait for user to press Enter before proceeding } }; @@ -107,12 +90,12 @@ class ProfessorOak { void greetPlayer(Player &player) { cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << name << ": My name is Oak. People call me the Pokemon Professor!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << name << ": But enough about me. Let's talk about you!\n"; - waitForEnter(); + Utility::waitForEnter(); } void offerPokemonChoices(Player &player) { @@ -122,17 +105,17 @@ class ProfessorOak { getline(std::cin, player.name); cout << name << ": Ah, " << player.name << "! What a fantastic name!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << name << ": You must be eager to start your adventure. But first, " "you’ll need a Pokemon of your own!\n"; - waitForEnter(); + Utility::waitForEnter(); // Presenting Pokemon choices cout << name << ": I have three Pokemon here with me. They’re all quite feisty!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << name << ": Choose wisely...\n"; cout << "1. Charmander - The fire type. A real hothead!\n"; cout << "2. Bulbasaur - The grass type. Calm and collected!\n"; @@ -145,66 +128,66 @@ class ProfessorOak { cin >> choice; player.choosePokemon(choice); - waitForEnter(); + Utility::waitForEnter(); } // New method for the main quest conversation void explainMainQuest(Player &player) { // Clear the console - clearConsole(); + Utility::clearConsole(); cout << "Professor Oak: " << player.name << "!, I am about to explain you about your upcoming grand " "adventure.\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "Professor Oak: You see, becoming a Pokémon Master is no easy " "feat. It takes courage, wisdom, and a bit of luck!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "Professor Oak: Your mission, should you choose to accept it—and " "trust me, you really don’t have a choice—is to collect all the " "Pokémon Badges and conquer the Pokémon League.\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "\n" << player.name << ": Wait... that sounds a lot like every other Pokémon game " "out there...\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "Professor Oak: Shhh! Don't break the fourth wall, " << player.name << "! This is serious business!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "\nProfessor Oak: To achieve this, you’ll need to battle wild " "Pokémon, challenge gym leaders, and of course, keep your " "Pokémon healthy at the PokeCenter.\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "Professor Oak: Along the way, you'll capture new Pokémon to " "strengthen your team. Just remember—there’s a limit to how " "many Pokémon you can carry, so choose wisely!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "\n" << player.name << ": Sounds like a walk in the park... right?\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "Professor Oak: Hah! That’s what they all say! But beware, " "young Trainer, the path to victory is fraught with " "challenges. And if you lose a battle... well, let’s just say " "you'll be starting from square one.\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "\nProfessor Oak: So, what do you say? Are you ready to " "become the next Pokémon Champion?\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "\n" << player.name << ": Ready as I’ll ever be, Professor!\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "\nProfessor Oak: That’s the spirit! Now, your journey begins...\n"; - waitForEnter(); + Utility::waitForEnter(); cout << "Professor Oak: But first... let's just pretend I didn't " "forget to set up the actual game loop... Ahem, onwards!\n"; - waitForEnter(); + Utility::waitForEnter(); } }; @@ -215,7 +198,7 @@ void gameLoop(Player &player) { while (keepPlaying) { // Clear console before showing options - clearConsole(); + Utility::clearConsole(); // Display options to the player cout << "\nWhat would you like to do next, " << player.name << "?\n"; @@ -267,7 +250,7 @@ void gameLoop(Player &player) { // Wait for Enter key before the screen is cleared and the menu is shown // again - waitForEnter(); + Utility::waitForEnter(); } cout << "Goodbye, " << player.name << "! Thanks for playing!\n";