• Source
    1. #include <iostream>
    2. #include <string>
    3. #include <tuple>
    4.  
    5. std::tuple<std::string, std::string, std::string, std::string> getPokemon(int num) {
    6. std::tuple<std::string, std::string, std::string, std::string> result;
    7. switch(num) {
    8. case 1: result = std::make_tuple("Bulbasaur", "Grass", "Vine whip, razor leaf, sleep powder, poison powder, stun spore, aromatheraphy, etc", "Evolves to Ivysaur Lv. 16"); break;
    9. case 2: result = std::make_tuple("Ivysaur", "Grass", "Vine whip, razor leaf, sleep powder, poison powder, stun spore, aromatheraphy, etc", "Evolves to Venasaur Lv. 36"); break;
    10. case 3: result = std::make_tuple("Venasaur", "Grass & Poison", "Vine whip, razor leaf, sleep powder, poison powder, stun spore, aromatheraphy, Leaf blade, leaf storm, synthesis, frenzyplant solar beam", "No further Evolutions"); break;
    11. case 4: result = std::make_tuple("Charmander", "Fire", "Ember flamethrower, fireblast, sunny day, leer, growl, scary face, flare blitZ, firespin", "Evolves to Charmeleon Lv. 16"); break;
    12. case 5: result = std::make_tuple("Charmeleon", "Fire", "Ember flamethrower, fireblast, sunny day, leer, growl, scary face, flare blitZ, firespin", "Evolves to Charizard Lv. 36"); break;
    13. case 6: result = std::make_tuple("Charizard", "Fire/Flying", "Ember flamethrower, fireblast, sunny day, leer, growl, scary face, flare blitZ, firespin, Blast Burn, wing attack", "No further evolutions"); break;
    14. case 7: result = std::make_tuple("Squirtle", "Water", "Bubblebeam, bubble, withdraw, tackle, hydro pump, water pulse, watergun, etc", "Evolves to wartortle Lv. 16"); break;
    15. case 8: result = std::make_tuple("Wartortle", "Water", "Bubblebeam, bubble, withdraw, tackle, hydro pump, water pulse, watergun, etc", "Evolves to Blastoise Lv. 36"); break;
    16. case 9: result = std::make_tuple("Blastoise", "Water", "Hydro Pump, watergun, water pulse, sull bash, iron defense, surf, rain dance, hydro cannon , etc", "No further evolutions"); break;
    17. case 10: result = std::make_tuple("Caterpie", "Bug", "tackle, string shot, poison sting", "Evolves to Metapod Lv. 6 or 7"); break;
    18. case 11: result = std::make_tuple("Metapod", "Bug", "Tackle, string shot, poison sting, Harden", "Evolves to Butterfree Lv.10"); break;
    19. case 12: result = std::make_tuple("Butterfree", "Bug/Flying", "Tackle, string shot, poison sting, harden, stun spore, sleep powder, gust, poisonpowder", "No Further evolutions"); break;
    20. case 13: result = std::make_tuple("Weedle", "Bug/Poison", "Tackle, string shot, poison sting", "Evolves to Kakuna Lv. 6 or 7"); break;
    21. case 14: result = std::make_tuple("Kakuna", "Bug/Poison", "Tackle, string shot, poison sting, harden", "Evolves to Beedrill Lv. 10"); break;
    22. case 15: result = std::make_tuple("Beedrill", "Bug/Poison", "Tackle, string shot, poison sting, twineedle, megahorn", "No Further evolutions"); break;
    23. case 16: result = std::make_tuple("Pidgey", "Normal/Flying", "Tackle, gust, wing attack, ariel ace, fly, peck, drill peck, sky drop, growl", "Evolves to Pidgeotto Lv. 14"); break;
    24. case 17: result = std::make_tuple("Pidgeotto", "Normal/Flying", "Tackle, gust, wing attack, ariel ace, fly, peck, drill peck, sky drop, growl, brave bird, sky attack", "Evolves to Pidgeot Lv. 32"); break;
    25. case 18: result = std::make_tuple("Pidgeot", "Normal/Flying", "Tackle, gust, wing attack, ariel ace, fly, peck, drill peck, sky drop, growl, brave bird, sky attack", "No Further evolutions"); break;
    26. case 19: result = std::make_tuple("Rattata", "Normal", "Tackle, bite, hyperfang, superfang, scaryface, growl, thief, leer", "Evolves to Raticate Lv. 18"); break;
    27. case 20: result = std::make_tuple("Raticate", "Normal", "Tackle, bite, hyperfang, superfang, scaryface, growl, thief, leer", "No Further evolutions"); break;
    28. case 21: result = std::make_tuple("Spearow", "Normal/Flying", "Tackle, gust, wing attack, ariel ace, fly, peck, drill peck, sky drop, growl, brave bird, sky attack", "Evolves to Fearow Lv.24"); break;
    29. case 22: result = std::make_tuple("Fearow", "Normal/Flying", "Tackle, gust, wing attack, ariel ace, fly, peck, drill peck, sky drop, growl, brave bird, sky attack", "No Further evolutions"); break;
    30. case 23: result = std::make_tuple("Ekans", "Poison", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "Evolves to Arabok"); break;
    31. case 24: result = std::make_tuple("Arabok", "Poison", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "No Further evolutions"); break;
    32. case 25: result = std::make_tuple("Pikachu", "Electric", "Thundershock, thunderbolt, thunder,irontail, volt tackle, electroball, shockwave, thunderwave, voltswitch", "Evolves into Raichu using a thundestone"); break;
    33. case 26: result = std::make_tuple("Raichu", "Electric", "Thundershock, thunderbolt, thunder,irontail, volt tackle, electroball, shockwave, thunderwave, voltswitch", "No Further evolutions"); break;
    34. case 27: result = std::make_tuple("Sandshrew", "Ground", "Dig, earthquake, Slash, double kick, growl, sand-attack", "Evolves into Sandslash"); break;
    35. case 28: result = std::make_tuple("Sandslash", "Ground", "Dig, earthquake, Slash, double kick, growl, sand-attack", "No Further evolutions"); break;
    36. case 29: result = std::make_tuple("Nidoran G", "Poison", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "Evolves to Nidorina"); break;
    37. case 30: result = std::make_tuple("Nidorina G", "Poison", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "Evolves to Nidoqueen"); break;
    38. case 31: result = std::make_tuple("Nidoran G", "Poison/Ground", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "No Further evolutions"); break;
    39. case 32: result = std::make_tuple("Nidoran M", "Poison", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "Evolves to Nidorino"); break;
    40. case 33: result = std::make_tuple("Nidorino", "Poison", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "Evolves to Nidoking"); break;
    41. case 34: result = std::make_tuple("Nidoking", "Poison/Ground", "Poison fang, coil, glare, scaryface, wrap, poison sting, poison tail", "No Further evolutions"); break;
    42. case 35: result = std::make_tuple("Clefairy", "Normal", "Pound,metronome,confuse ray, doubleslap, swift", "Evolves to Moonstone"); break;
    43. case 36: result = std::make_tuple("Clefable", "Normal", "Pound, metronome, swift, doubleslap", "No Further evolutions"); break;
    44. /*
    45.   Default not needed since we are doing input validation in main...
    46.   default: result = std::make_tuple("", "", "", "");
    47.   */
    48. }
    49. return result;
    50. }
    51.  
    52. int main() {
    53. int pokemon;
    54. std::cout << "Please enter the pokemons pokedex number (1 - 36)" << std::endl;
    55. std::cin >> pokemon;
    56.  
    57. if(pokemon < 0 || pokemon > 36) {
    58. std::cout << "INPUT ERROR: Pokedex between 1 and 36 ONLY ARE SUPPORTED. Please try again." << std::endl;
    59. /* At this point we can goto again to the input or exit with a negative number */
    60. return -1;
    61. }
    62.  
    63. auto character = getPokemon(pokemon);
    64. std::cout << std::endl << "No." << pokemon << ": " << std::get<0>(character) << std::endl << "Type: " << std::get<1>(character) << std::endl << "Movelist: " << std::get<2>(character) << std::endl << "Evolution: " << std::get<3>(character) << std::endl;
    65.  
    66. return 0;
    67. }