‹›Expansion de la base de connaissanceTrouvez un Pokémon puissant
En plus des centaines de types d'entité couvrant les domaines scientifiques, géographiques et autres «sérieux», la version 11 inclut également des données intégrées sur les entités amusantes comme Pokémon, avec des informations sur les noms, les chemins évolutifs, les capacités et les statistiques d'attaque et de défense.
Trouvez la hauteur de Pikachu.
Entity["Pokemon", "Pokedex0025:Pikachu"][
EntityProperty["Pokemon", "Height"]]
Obtenez une association de données sur Miaouss.
Entity["Pokemon", "Pokedex0052:Meowth"]["PropertyAssociation"]
Trouvez un Pokémon correspondant étroitement à une taille et un poids donné.
Montrer l'entrée complète de Wolfram Language
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]
De là, vous pouvez calculer les dommages de combat pour un Pokémon spécifique.
Montrer l'entrée complète de Wolfram Language
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]
Vous pouvez alors trouver le Pokémon le plus puissant sur la base de points statistiques totaux.
powerful = EntityList[
Entity["Pokemon", {
"Generation" -> Entity["PokemonGeneration", "GenerationI"],
"StatTotal" -> TakeLargest[10]}]]
Trouvez Pokémon de feu avec un point d'attaque supérieur à 50 et un point de défense de moins de 40.
EntityValue[EntityList[
Entity["Pokemon", {
"Type" -> "Fire", "Attack" -> GreaterThan[50],
"Defense" -> LessThan[40]}]], "Image", "EntityAssociation"]
Trouvez un Pokémon rose avec un poids supérieur à 250 lb.
EntityValue[EntityList[
Entity["Pokemon", {
"PokedexColor" -> Entity["PokemonPokedexColor", "Pink"],
"Weight" -> GreaterThan[
Quantity[250, "Pounds"]]}]], "Image", "EntityAssociation"]