Facebook
From Scanty Hog, 4 Years ago, written in Plain Text.
This paste is a reply to Untitled from Sole Pelican - go back
Embed
Viewing differences between Untitled and Re: Untitled
\nplayer = {
    "name": "Saul",
    "health": 100,
    "damage": 10
    }
ender_dragon = {
    "health": 10,
    "damage": 5,
    "name": "Ender Dragon"
    }
villager = {
    "health": 20,
    "damage": 10,
    "name": "Janet"
    }

def fight(p1, p2):
    print(f"{p1['name']} vs {p2['name']}")
    p1['health'] -= p2['damage']
    p2['health'] -= p1['damage']
    print("After the fight, here's how they look")
    print(f"{p1['health']} vs {p2['health']}")
    
fight(player, ender_dragon)