Wolfram Language

Expansão da base de conhecimento

Encontre Pokémons poderosos

Além das centenas de variedades de entidade que abrangem domínios científicos, geográficas e outros domínios "sérios", a versão 11 também inclui dados internos sobre entidades divertidas, como Pokémon, com informações sobre nomes, caminhos evolutivos, habilidades e estatísticas de ataque e defesa.

Saiba a altura do Pikachu.

In[1]:=
Click for copyable input
Entity["Pokemon", "Pokedex0025:Pikachu"][ EntityProperty["Pokemon", "Height"]]
Out[1]=

Obtenha uma associação de dados sobre o Meowth.

In[2]:=
Click for copyable input
Entity["Pokemon", "Pokedex0052:Meowth"]["PropertyAssociation"]
Out[2]=

Encontre Pokémons que coincidem com um determinado peso e altura.

mostre o input completo da Wolfram Language
In[3]:=
Click for copyable input
Manipulate[ Grid@Partition[ Normal@EntityValue[ Entity["Pokemon", {"Weight" -> Quantity[ Interval[{w - 5, w + 5}], "Kilograms"], "Height" -> Quantity[ Interval[{h - 5, h + 5}], "Centimeters"]}], "Image", "EntityAssociation"] /. r_Rule :> Tooltip[r[[2]], r[[1]]], UpTo[3]], {{w, 30, "weight (kg)"}, 10, 200, 1, Appearance -> "Open"}, {{h, 130, "height (cm)"}, 100, 200, 1, Appearance -> "Open"}, ContinuousAction -> False, SynchronousUpdating -> False, SynchronousInitialization -> False]
Reproduzir
Parar

A partir disso, você pode calcular os danos de uma batalha para um Pokémon específico.

mostre o input completo da Wolfram Language
In[4]:=
Click for copyable input
Style[Manipulate[DynamicModule[{damage}, damage = ((((2*level*(criticalHit /. {True -> 2, False -> 1})/5 + 2)*attack*power/defense)/50 + 2)*(MatchQ[ Intersection @@ EntityValue[{attPokemon, defPokemon}, "Type"], {}] /. {True -> 1, False -> 1.5})*typeModifier)* Interval[{85, 100}]/100; Column[{Row[{"base statistics:"}, BaseStyle -> Bold], Grid[{{Null, "attacker", "defender"}, {"image", attPokemon["Image"], defPokemon["Image"]}, {"name", attPokemon["Name"], defPokemon["Name"]}, {"HP", attPokemon["HitPoints"], defPokemon["HitPoints"]}, {"attack", attPokemon["Attack"], defPokemon["Attack"]}, {"defense", attPokemon["Attack"], defPokemon["Defense"]}, {"special attack", attPokemon["Attack"], defPokemon["SpecialAttack"]}, {"special defense", attPokemon["Attack"], defPokemon["SpecialDefense"]}}, Background -> {None, {Lighter[Yellow, .9], {White, Lighter[Gray, .8]}}}, Frame -> All, FrameStyle -> Directive[Gray, Thick], Spacings -> {1, 1}], Row[{Null}], Row[{"damage:"}, BaseStyle -> Bold], Grid[{{"min", "average", "max"}, {N[Min[#]], N[Mean @@ #], N[Max[#]]} &@damage}, Frame -> All, FrameStyle -> Directive[Gray, Thick], Spacings -> {1, 1}, Background -> {None, {Lighter[Yellow, .9], White}}] }, BaseStyle -> {FontFamily -> "Helvetica"}] ], {{level, 50, "level"}, 1, 100, ControlType -> InputField}, {{attPokemon, Entity["Pokemon", "Pokedex0025:Pikachu"], "attacking Pokemon"}, pm, ControlType -> PopupMenu}, {{attack, 35, "attack"}, 1, 1000, ControlType -> InputField}, {{power, 90, "power"}, 1, 300, ControlType -> InputField}, {{defPokemon, Entity["Pokemon", "Pokedex0052:Meowth"], "defensing Pokemon"}, pm, ControlType -> PopupMenu}, {{defense, 35, "defense"}, 1, 1000, ControlType -> InputField}, {{typeModifier, 1, "type modifier"}, {4, 2, 1, 0.5, 0.25, 0}, ControlType -> PopupMenu}, {{criticalHit, False, "critical hit"}, {True, False}, ControlType -> Setter}, ContinuousAction -> False, SynchronousUpdating -> False, ControlPlacement -> Bottom, SynchronousInitialization -> False, Initialization :> {pm = First /@ SortBy[Normal@ EntityValue[EntityClass["Pokemon", All], "Name", "EntityAssociation"], Last]}], DynamicEvaluationTimeout -> Infinity]
Reproduzir
Parar

Você pode encontrar o Pokémon mais poderoso com base ns pontos estatísticos totais.

In[5]:=
Click for copyable input
powerful = EntityList[ Entity["Pokemon", { "Generation" -> Entity["PokemonGeneration", "GenerationI"], "StatTotal" -> TakeLargest[10]}]]
Out[5]=

Encontre um Pokémon tipo fogo com o ponto de ataque maior que 50 e de defesa menor que 40.

In[6]:=
Click for copyable input
EntityValue[EntityList[ Entity["Pokemon", { "Type" -> "Fire", "Attack" -> GreaterThan[50], "Defense" -> LessThan[40]}]], "Image", "EntityAssociation"]
Out[6]=

Encontre um Pokémon rosa com peso superior a 250 libras.

In[7]:=
Click for copyable input
EntityValue[EntityList[ Entity["Pokemon", { "PokedexColor" -> Entity["PokemonPokedexColor", "Pink"], "Weight" -> GreaterThan[ Quantity[250, "Pounds"]]}]], "Image", "EntityAssociation"]
Out[7]=

Exemplos Relacionados

de en es fr ja ko ru zh