Skip to content

Instantly share code, notes, and snippets.

@dstoza
Created December 28, 2015 05:36
Show Gist options
  • Save dstoza/274f7eeee22db3f2e41a to your computer and use it in GitHub Desktop.
Save dstoza/274f7eeee22db3f2e41a to your computer and use it in GitHub Desktop.
class Creature:
def __init__(self, name, hp):
self.name = name
self.hp = hp
class Monster(Creature):
def __init__(self, name, hp, attrs):
Creature.__init__(self, name, hp)
self.int = 10
if 'int' in attrs:
self.int = attrs['int']
kobold_attrs = {'int': 6}
kobold = Monster('Kobold', 10, kobold_attrs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment