← 返回 openai 的题目列表Pokémon Battle Simulation
类型:online_judge
Problem Description
Implement a simplified Pokémon battle game. The game should support basic battle mechanics, including Pokémon and skill type effectiveness. Detailed requirements are as follows:
Each Pokémon has its own HP and a list of skills (each skill has power and type), and different Pokémon may have type effectiveness.
Write a function to simulate a battle between two Pokémon. The outcome should be based on the skills chosen by each Pokémon and their types.
Provide log output to track the attack details of each round.
Test Cases
Input: Pokémon A: HP=100, Skills=[('Tackle', 10, 'Normal')]; Pokémon B: HP=100, Skills=[('Scratch', 8, 'Normal')] Output: Battle logs and winner
Input: Pokémon A: HP=120, Skills=[('Ember', 10, 'Fire')]; Pokémon B: HP=90, Skills=[('Water Gun', 12, 'Water')] Output: Battle logs and winner
Input: Pokémon A: HP=100, Skills=[('Thunder Shock', 15, 'Electric')]; Pokémon B: HP=100, Skills=[('Vine Whip', 12, 'Grass')] Output: Battle logs and winner
Input: Pokémon A: HP=80, Skills=[('Quick Attack', 7, 'Normal')]; Pokémon B: HP=130, Skills=[('Tackle', 6, 'Normal')] Output: Battle logs and winner
Input: Pokémon A: HP=100, Skills=[]; Pokémon B: HP=100, Skills=[('Scratch', 8, 'Normal')] Output: Pokémon B wins since Pokémon A has no skills