Question: matlab no iterations Problem Summary Function Name: pokoFighter Inputa: 1. (doubie) A. 14 vectar containing the stats of Player 1's Pokemon 2. (coubie) A 14
matlab no iterations
Problem Summary Function Name: pokoFighter Inputa: 1. (doubie) A. 14 vectar containing the stats of Player 1's Pokemon 2. (coubie) A 14 vectar containing the stats af Player 2 s Pokemon 3. (char) Player 1's Pokemor's name 4. (char) Player Z s Pokemon's name Outputb: 1. (Char) A sentence detaling the winner of the fight Function Deacription: Everyane knows that to be the very best you've got to catch thern all, but what a lot af people don't realize is you've got ta fight thern all too. In this situati Write a function to simulate a battle between two Pokemon. First. find the types af the twa players' Pokemon. If the Pokernon's narne is... - Squirtle, Wartortlc, ar Blastoisc, then the type is Waier - Bulbasaur, Ivysaur, or Venusaur, then the type is Grass - Charmander, Charmelcon, or Charizard, then the type is Fire All Pakeman names (inputs 3 and 4 ) will be ane of the 9 names listed above. The vectors provided (inputs 1 and 2 ) will always be in the following format If the Pakernan type is... - Water, add 32 to its HP - Grass, muliply it's defense by a factar of 1.25 - Fire, multiply its atlack by a factor 2 Next, you should consider the type matches. Water is strong against Fire. Fire is strong against Grass, and Grass is strong against. Water. The weaker type in each case should have 22 subtracted fram its definse. Next have Pakemon deal attacks. The attack formula is as fallows for Player 1 (attacker, atk-) attacking Player 2 (defender, def.): Def. Final HP=Def. HP -((Atk. Attack.Atk. Level / 50)-Def. Defense ) If this 1 st athack brings Player 2 to 0HP or lower, Player 1 wins! If not, Player 2 attacks Player 1 . The player with the most HP after this 2 nd atlack wins. Example: plstats - [75 374453]; p2stats - [63 263949 plpoke - 'Bulbasaur'; p2poke - 'Charizard'; str - pokeFighter(p1stats, p2stats, plpoke, p2poke) \& 22 str - 'Player 2 is the winner and their Pokenon Charizard is victoricusll!' Notes: - The player's stats will always be in the same crder ([HP, Attack, Defense, Level]) - The Pokemons' names are case sensitive and are guaranteed to be spelled exactly like one of the names listed in the problem description. - All values in the stats vectors will be positive integers. - The battle will never result in a tie
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
