Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
8
Help us understand the problem. What is going on with this article?

More than 3 years have passed since last update.

@YumaInaura

いつの間にか Faker が ポケモンに対応していた

説明しよう。 Faker はダミーデータを作るための ruby gem だ。
このFakerでポケモンの「名前」と「場所」が生成できるようになっていた。

image

検証: ポケモンは何種類登録されているのか?

$ gem install faker
$ pry 
[35] pry(main)> require 'faker'
=> true

pokemons = []; 100000.times { pokemons.push Faker::Pokemon.name }; pokemons.uniq.size
=> 149

結論

149匹。

ラインナップ

[4] pry(main)> pokemons = []; 100000.times { pokemons.push Faker::Pokemon.name }; pokemons.uniq.sort
=> ["Abra",
 "Aerodactyl",
 "Alakazam",
 "Arbok",
 "Arcanine",
 "Articuno",
 "Beedrill",
 "Bellsprout",
 "Blastoise",
 "Bulbasaur",
 "Butterfree",
 "Caterpie",
 "Chansey",
 "Charizard",
 "Charmander",
 "Charmeleon",
 "Clefable",
 "Clefairy",
 "Cloyster",
 "Cubone",
 "Dewgong",
 "Diglett",
 "Ditto",
 "Dodrio",
 "Doduo",
 "Dragonair",
 "Dragonite",
 "Dratini",
 "Drowzee",
 "Dugtrio",
 "Eevee",
 "Ekans",
 "Electabuzz",
 "Electrode",
 "Exeggcute",
 "Exeggutor",
 "Farfetch'd",
 "Fearow",
 "Flareon",
 "Gastly",
 "Gengar",
 "Geodude",
 "Gloom",
 "Golbat",
 "Goldeen",
 "Golduck",
 "Golem",
 "Graveler",
 "Grimer",
 "Growlithe",
 "Gyarados",
 "Haunter",
 "Hitmonchan",
 "Hitmonlee",
 "Horsea",
 "Hypno",
 "Ivysaur",
 "Jigglypuff",
 "Jolteon",
 "Jynx",
 "Kabuto",
 "Kabutops",
 "Kadabra",
 "Kakuna",
 "Kangaskhan",
 "Kingler",
 "Koffing",
 "Krabby",
 "Lapras",
 "Lickitung",
 "Machamp",
 "Machoke",
 "Machop",
 "Magikarp",
 "Magmar",
 "Magnemite",
 "Magneton",
 "Mankey",
 "Marowak",
 "Meowth",
 "Metapod",
 "Mewtwo",
 "Moltres",
 "Mr.",
 "Muk",
 "Nidoking",
 "Nidoqueen",
 "Nidoran",
 "Nidorina",
 "Nidorino",
 "Ninetales",
 "Oddish",
 "Omanyte",
 "Omastar",
 "Onix",
 "Paras",
 "Parasect",
 "Persian",
 "Pidgeot",
 "Pidgeotto",
 "Pidgey",
 "Pikachu",
 "Pinsir",
 "Poliwag",
 "Poliwhirl",
 "Poliwrath",
 "Ponyta",
 "Porygon",
 "Primeape",
 "Psyduck",
 "Raichu",
 "Rapidash",
 "Raticate",
 "Rattata",
 "Rhydon",
 "Rhyhorn",
 "Sandshrew",
 "Sandslash",
 "Scyther",
 "Seadra",
 "Seaking",
 "Seel",
 "Shellder",
 "Slowbro",
 "Slowpoke",
 "Snorlax",
 "Spearow",
 "Squirtle",
 "Starmie",
 "Staryu",
 "Tangela",
 "Tauros",
 "Tentacool",
 "Tentacruel",
 "Vaporeon",
 "Venomoth",
 "Venonat",
 "Venusaur",
 "Victreebel",
 "Vileplume",
 "Voltorb",
 "Vulpix",
 "Wartortle",
 "Weedle",
 "Weepinbell",
 "Weezing",
 "Wigglytuff",
 "Zapdos",
 "Zubat"]

環境

  • faker (1.6.6)
  • Mac OS X El Capitan
8
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
8
Help us understand the problem. What is going on with this article?