CLI RPG Character Battle

Medium Applied OOP Mini Projects PRO
🔒 Login to Unlock

Problem Statement

Create a `Character` class (name, hp, atk). Simulate turns until one drops <= 0 HP or T rounds pass. Print remaining HP of both characters.

Input Format

Line 1: Name1 HP1 Atk1. Line 2: Name2 HP2 Atk2. Line 3: turns T (alternating strikes starting with Name1).

Output Format

Print Name1:HP1
Name2:HP2

Constraints

HP, Atk > 0, T >= 1

Sample Input

Hero 30 10
Goblin 20 8
3

Sample Output

Hero:22
Goblin:10

Explanation

Hero hits Goblin (20-10=10). Goblin hits Hero (30-8=22). Hero hits Goblin (10-10=0, dead). Battle stops.

Starter Code

class Character:
    pass

if __name__ == '__main__':
    # Implement battle logic here
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used