BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//American Young Coder - ECPv6.10.1.1//NONSGML v1.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:American Young Coder
X-ORIGINAL-URL:https://www.ayclogic.com
X-WR-CALDESC:Events for American Young Coder
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-Robots-Tag:noindex
X-PUBLISHED-TTL:PT1H
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:PDT
DTSTART:20230312T100000
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:PST
DTSTART:20231105T090000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=America/Los_Angeles:20230620T170000
DTEND;TZID=America/Los_Angeles:20230620T180000
DTSTAMP:20260425T153331
CREATED:20230621T011833Z
LAST-MODIFIED:20230621T011849Z
UID:20301-1687280400-1687284000@www.ayclogic.com
SUMMARY:5:00 PM – Python Object Oriented Programming – Sebastian
DESCRIPTION:Today We Did\n\nIntroduction to inheritance\nBegan Monster System project\nIn case you need anything\, feel free to email me at sebastian@ayclogic.com\n\nHomework\n\nName your homework JUN20_monster_system_hw\, please submit by next Monday.\nHomework: Follow the instructions to build on to the code we made in class.a) Add on to our previous code from the MonsterSystem class so that the following monsters get these health and max_attack ranges:\ndragon\, 100\, 50\ntroll\, 50\, 20\nwater_golem\, 30\, 20\ncyclops\, 60\, 30 \nb) Now we should have 3 variables in our add_monster() method. Use these 3 variables to create a Monster object\, passing those 3 variables in as parameters to the constructor. \nc) Finally time to use our self.monster_dictionary attribute. Use the species variable as the key\, and the object we made in part (b) as the value. AKA\, add the new monster object to our dictionary using species as the key. \nCode from class in case you lost it: \n\nimport random\n\nclass MonsterSystem:\n\n    def __init__(self):\n        self.main_menu = """\nMain Menu\n1. Add Monster\n2. List all monsters\n3. Play Adventure\n4. Exit\nEnter your selection: """\n\n        self.attack_menu = """\n1. Magic attack\n2. Sword attack - 10 to 20 damage\nEnter your selection: """\n\n        self.magic_attack_menu = """\nWhat kind of magic attack you want to do:\n1. Fire magic  - Max damage: 10\n2. Water magic - Max damage: 10\n3. Earth magic - Max damage: 15\n4. Wind magic  - Max damage:  8 \nEnter your selection: """\n\n        self.monster_list = ["dragon"\, "troll"\, "water_golem"\, "cyclops"]\n        self.monster_healths = {\n            "dragon": 100\n        }\n        self.monster_max_attacks = {\n            "dragon": 50\n        }\n        self.monster_dictionary = {}\n        self.player_health = 200\n\n    def add_monster(self):\n        species = random.choice(self.monster_list)\n        health = random.randint(self.monster_healths[species])\n        max_attack = random.randint(self.monster_max_attacks[species]\n\n    def application_loop(self):\n        while True:\n            selection = input(self.main_menu)\n            if selection == "1":\n                self.add_monster()
URL:https://www.ayclogic.com/event/500-pm-python-object-oriented-programming-sebastian-10/
CATEGORIES:OOP Python,Python Class
END:VEVENT
END:VCALENDAR