Facebook
From Sole Pelican, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 135
  1.  
  2. player = {
  3.     "name": "Saul",
  4.     "health": 100,
  5.     "damage": 10
  6.     }
  7. ender_dragon = {
  8.     "health": 10,
  9.     "damage": 5,
  10.     "name": "Ender Dragon"
  11.     }
  12. villager = {
  13.     "health": 20,
  14.     "damage": 10,
  15.     "name": "Janet"
  16.     }
  17.  
  18. def fight(p1, p2):
  19.     print(f"{p1['name']} vs {p2['name']}")
  20.     p1['health'] -= p2['damage']
  21.     p2['health'] -= p1['damage']
  22.     print("After the fight, here's how they look")
  23.     print(f"{p1['health']} vs {p2['health']}")
  24.    
  25. fight(player, ender_dragon)    
  26.  

Replies to Untitled rss

Title Name Language When
Re: Untitled Scanty Hog text 4 Years ago.