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
4 changes: 3 additions & 1 deletion Pokemon/.idea/.idea.Pokemon/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 62 additions & 14 deletions Pokemon/.idea/.idea.Pokemon/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added Pokemon/Test.txt
Empty file.
31 changes: 31 additions & 0 deletions Pokemon/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
#include <iostream>
#include <map>
#include <vector>
using namespace std;

map<int,vector<string>> static PokemonChecker = {{1, {"Bulbasaur", "wise"}},{2, {"Charmander", "fiery"}},{3, {"Squirtle", "cool"}}};

void starter()
{
while (true)
{
cout << "You can choose one of the following Pokemon:\n";
for (const auto& i : PokemonChecker)
{
cout << i.first << ". " << *i.second.begin() << "\n";
}
cout << "Which Pokemon would you like to choose? Enter the number: ";

int choice;
cin >> choice;

if (PokemonChecker.find(choice) != PokemonChecker.end()) {
std::cout << "You chose " << *PokemonChecker[choice].begin() << "! A " << PokemonChecker[choice].back() << " choice.\n";
break;
} else {
std::cout << "Invalid choice. Please restart.\n";
}
}
}

int main() {
cout << "Welcome to the world of Pokemon! I am Professor Oak.\n";

starter();

return 0;
}