Домашни > Работилница за отвари! > Решения > Решението на Божидар Кьоров

Резултати
3 точки от тестове
0 точки от учител

3 точки общо

6 успешни теста
14 неуспешни теста
Код

  1import math 
  2import copy
  3
  4#написано до Преходност
  5#done except tick()
  6
  7class Potion:
  8
  9    def __init__(self, effects : dict, duration : int) -> None:
 10        self.effects = effects
 11        self.duration = duration
 12        self.used_effects = set()
 13        self.potency = dict.fromkeys(effects, 1)
 14        self.used = False
 15
 16    def __getattr__(self, name : str):
 17        if name in self.effects:
 18            if name not in self.used_effects:
 19                self.used_effects .add(name)
 20                return self.__apply_potency__(name)
 21            else:
 22                raise TypeError("Effect is depleted.")
 23    
 24    def __add__(self, other):
 25        if self.used:
 26            raise TypeError("Potion is now part of something bigger than itself.")
 27        
 28        self.used_effects .update(other.used)
 29        self.duration = max(self.duration, other.duration)
 30        for effect in other.effects:
 31            if effect in self.effects:
 32                self.potency[effect] += other.potency[effect]
 33            else:
 34                self.effects[effect] = other.effects[effect]
 35        
 36        self.used = True
 37        return self
 38    
 39    def __sub__(self, other):
 40        if self.used:
 41            raise TypeError("Potion is now part of something bigger than itself.")
 42        
 43        self.used_effects .difference(other.used)
 44        for effect in other.effects:
 45            if effect in self.effects:
 46                self.potency[effect] -= other.potency[effect]
 47            else:
 48                raise TypeError(f"Effect \"{effect}\" not present.")
 49
 50        self.__delete_removed_effects__()
 51
 52        self.used = True
 53        return self
 54    
 55    def __mul__(self, number):
 56        if self.used:
 57            raise TypeError("Potion is now part of something bigger than itself.")
 58        
 59        for effect in self.potency:
 60            self.potency[effect] *= number
 61            if (self.potency[effect] - math.floor(self.potency[effect])) > 0.5:
 62                self.potency[effect] = math.ceil(self.potency[effect])
 63            else:
 64                self.potency[effect] = math.floor(self.potency[effect])
 65
 66        self.__delete_removed_effects__()   
 67
 68        self.used = True    
 69        return self
 70    
 71    def __truediv__ (self, number : int):
 72        if self.used:
 73            raise TypeError("Potion is now part of something bigger than itself.")
 74        
 75        temp_potion = Potion(effects=self.effects, duration=self.duration)
 76        temp_potion.potency = self.potency
 77        temp_potion = temp_potion * (1 / number)
 78        temp_potion.__delete_removed_effects__()
 79
 80        self.used = True
 81        return [temp_potion for _ in range(number)]
 82
 83    def __eq__(self, other: object) -> bool:
 84        if self.__total_potency__() != other.__total_potency__():
 85            return False
 86
 87        return self.__compare__effects__(other)
 88    
 89    def __lt__(self, other: object) -> bool:
 90        return self.__total_potency__() < other.__total_potency__()
 91    
 92    def __rt__(self, other: object) -> bool:
 93        return self.__total_potency__() > other.__total_potency__()
 94    
 95    def __apply_potency__(self, name):
 96        def apply_potion(target):
 97            for _ in range(self.potency[name]):
 98                self.effects[name](target)
 99            #return target
100        return apply_potion
101    
102    def __delete_removed_effects__(self) -> None:
103        #self.effects = {effect:self.effects[effects] for effect in self.effects if self.potency[effect] > 0}
104        #self.potency = {effect:self.potency[effects] for effect in self.potency if effect in self.effect}
105    
106        for effect in self.potency:
107            if self.potency[effect] <= 0:
108                self.effects.pop(effect)
109                self.potency[effect] = 0
110
111        self.potency = {effect:self.potency[effect] for effect in self.effects}
112
113    def __total_potency__(self) -> int:
114        return sum([self.potency[effect] for effect in self.potency])
115    
116    def __compare__effects__(self, __other):
117        for effect in self.effects:
118            if effect not in __other.effects:
119                return False
120            
121        return True
122
123def calculate_molecular_mass(name : str) -> int:
124    return sum(ord(symbol) for symbol in name)
125
126class ГоспожатаПоХимия:
127
128    def __init__(self) -> None:
129        self.potion_effects = dict()
130        self.original_targets = dict()
131        self.affected_targets = set()
132        
133    def apply(self, target, potion : Potion) -> None:
134        if potion.used:
135            raise TypeError("Potion is depleted.")
136        
137        self.affected_targets.add(target)
138        original_target = copy.deepcopy(target)
139        self.original_targets[id(target)] = original_target
140        if id(target) not in self.potion_effects:
141            self.potion_effects[id(target)] = [potion]
142        else:
143            self.potion_effects[id(target)].append(potion)
144
145        for effect in potion.effects:
146            potion.effects[effect](target)
147            
148        potion.used = True
149
150    def tick(self) -> None:
151        for target in self.affected_targets:
152            flag = False
153            for potion in self.potion_effects[id(target)]:
154                if potion.duration > 0:
155                    potion.duration -= 1
156                else:
157                    flag = True
158            if flag:
159                self.potion_effects[id(target)] = [potion for potion in self.potion_effects[id(target)] if potion.duration > 0]
160                temp_target = copy.deepcopy(self.original_targets[id(target)])
161                for potion in self.potion_effects[id(target)]:
162                    potion.used = False
163                    self.apply(temp_target, potion)
164                target = temp_target
165
166
167                    
168  
169"""
170
171effects = {'grow': lambda target: setattr(target, 'size', target.size*2)}
172
173class Target:
174
175    def __init__(self) -> None:
176        self.size = 5
177
178class TestTarget:
179    def __init__(self, x , y, size) -> None:
180        self.x = x
181        self.y = y
182        self.size = size
183
184target = Target()
185
186grow = Potion(effects=effects, duration=3)
187print(target.size)
188narco = ГоспожатаПоХимия()
189narco.apply(target, grow)
190
191print(target.size)
192narco.tick()
193print(target.size)
194narco.tick()
195print(target.size)
196narco.tick()
197print(target.size)
198narco.tick()
199print(target.size)
200narco.tick()
201print(target.size)
202
203
204teleport_potion
205combined_potion = teleport_potion + grow_potion
206 
207target = TestTarget(1, 1, 1)
208 
209combined_potion.teleport(target)
210combined_potion.grow(target)
211 
212"""
213
214#target.size = 5
215#grow = Potion(effects=effects, duration=2) * 3
216#grow.grow(target)
217#print(target.size)
218
219#target.size = 5
220#grow = Potion(effects=effects, duration=2) * 3
221#grow = grow * 0.33
222#grow.grow(target)
223#print(target.size)
224
225#target.size = 5
226#grow = Potion(effects=effects, duration=2) * 3
227#grow = grow - Potion(effects=effects, duration=2)
228#grow = grow - Potion(effects=effects, duration=2)
229#grow = grow - Potion(effects=effects, duration=2)
230#grow.grow(target)
231#print(target.size)
232
233
234#grow = Potion(effects=effects, duration=2)
235#grow.potency["grow"] = 4
236
237#small_grow ,_= grow / 2
238#small_grow.grow(target)
239#print(target.size)
240
241#grow = Potion(effects=effects, duration=2)
242#grow2 = Potion(effects=effects, duration=2)
243#grow2.potency["grow"] = 1
244#print(grow == grow2)
245
246
247#d = { "d":3454, "22":3456, "agds":5345, "A":456, "X":4567, "CCCCCCCCCCCCCCCCCCC":56}
248#d={k:d[k] for k in sorted(d,key=calculate_molecular_mass)}
249#print(d)
250
251#target = Target()
252#target2 = copy.copy(target)
253#print(target.size, target2.size)
254#target2.size = 10
255#print(target.size, target2.size)

...E.EEEE.EEF.FFEFEF
======================================================================
ERROR: test_equal (test.TestPotionComparison)
Test equality of potions.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 292, in test_equal
self.assertEqual(potion1 + potion2, potion3)
File "/tmp/solution.py", line 28, in __add__
self.used_effects .update(other.used)
TypeError: 'bool' object is not iterable

======================================================================
ERROR: test_combination_no_overlap (test.TestPotionOperations)
Test combining potions with no overlap.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 93, in test_combination_no_overlap
potion = potion1 + potion2
File "/tmp/solution.py", line 28, in __add__
self.used_effects .update(other.used)
TypeError: 'bool' object is not iterable

======================================================================
ERROR: test_combination_with_overlap (test.TestPotionOperations)
Test combining potions with overlap.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 103, in test_combination_with_overlap
potion = potion1 + potion2
File "/tmp/solution.py", line 28, in __add__
self.used_effects .update(other.used)
TypeError: 'bool' object is not iterable

======================================================================
ERROR: test_deprecation (test.TestPotionOperations)
Test deprecation of a potion.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 256, in test_deprecation
potion = potion1 + potion2
File "/tmp/solution.py", line 28, in __add__
self.used_effects .update(other.used)
TypeError: 'bool' object is not iterable

======================================================================
ERROR: test_dilution (test.TestPotionOperations)
Test dilution of a potion.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 119, in test_dilution
half_potion.int_attr_fun(self._target)
TypeError: 'NoneType' object is not callable

======================================================================
ERROR: test_purification (test.TestPotionOperations)
Test purification of a potion.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 165, in test_purification
potion = potion1 - potion2
File "/tmp/solution.py", line 43, in __sub__
self.used_effects .difference(other.used)
TypeError: 'bool' object is not iterable

======================================================================
ERROR: test_separation (test.TestPotionOperations)
Test separation of a potion.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 213, in test_separation
potion1, potion2, potion3 = potion / 3
File "/tmp/solution.py", line 73, in __truediv__
raise TypeError("Potion is now part of something bigger than itself.")
TypeError: Potion is now part of something bigger than itself.

======================================================================
ERROR: test_ticking_immutable (test.TestГоспожатаПоХимия)
Test ticking after applying a potion with immutable attributes.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 423, in test_ticking_immutable
potion = potion1 + potion2 # Excepted duration is 2 with intensity of 2
File "/tmp/solution.py", line 28, in __add__
self.used_effects .update(other.used)
TypeError: 'bool' object is not iterable

======================================================================
ERROR: test_ticking_multiple_targets (test.TestГоспожатаПоХимия)
Test ticking after applying a potion with mutable attributes.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 485, in test_ticking_multiple_targets
self._dimitrichka.apply(target1, potion1)
File "/tmp/solution.py", line 135, in apply
raise TypeError("Potion is depleted.")
TypeError: Potion is depleted.

======================================================================
FAIL: test_applying_depleted_potion (test.TestГоспожатаПоХимия)
Test applying a depleted potion or a potion that was used in a reaction.
----------------------------------------------------------------------
TypeError: Potion is now part of something bigger than itself.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/tmp/test.py", line 382, in test_applying_depleted_potion
with self.assertRaisesRegex(TypeError, 'Potion is depleted\.'):
AssertionError: "Potion is depleted\." does not match "Potion is now part of something bigger than itself."

======================================================================
FAIL: test_applying_order (test.TestГоспожатаПоХимия)
Test applying order of a potion.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 405, in test_applying_order
self.assertEqual(self._target.int_attr, 12)
AssertionError: 14 != 12

======================================================================
FAIL: test_applying_part_of_potion (test.TestГоспожатаПоХимия)
Test applying only a part of a potion.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 366, in test_applying_part_of_potion
self.assertEqual(self._target.int_attr, 5) # This should be the original value
AssertionError: 50 != 5

======================================================================
FAIL: test_ticking_multiple_potions (test.TestГоспожатаПоХимия)
Test ticking after applying multiple potions which affect the same attribute.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 458, in test_ticking_multiple_potions
self.assertEqual(self._target.int_attr, 50)
AssertionError: 500 != 50

======================================================================
FAIL: test_ticking_mutable (test.TestГоспожатаПоХимия)
Test ticking after applying a potion with mutable attributes.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 444, in test_ticking_mutable
self.assertEqual(self._target.int_attr, 5)
AssertionError: 50 != 5

----------------------------------------------------------------------
Ran 20 tests in 0.002s

FAILED (failures=5, errors=9)

Дискусия
История

n1from typing import Anyn
2import math 1import math 
3import copy2import copy
43
5#написано до Преходност4#написано до Преходност
6#done except tick()5#done except tick()
76
8class Potion:7class Potion:
98
10    def __init__(self, effects : dict, duration : int) -> None:9    def __init__(self, effects : dict, duration : int) -> None:
11        self.effects = effects10        self.effects = effects
12        self.duration = duration11        self.duration = duration
13        self.used_effects = set()12        self.used_effects = set()
14        self.potency = dict.fromkeys(effects, 1)13        self.potency = dict.fromkeys(effects, 1)
15        self.used = False14        self.used = False
1615
n17    def __getattr__(self, __name : str) -> Any:n16    def __getattr__(self, name : str):
18        if __name in self.effects:17        if name in self.effects:
19            if __name not in self.used_effects :18            if name not in self.used_effects:
20                self.used_effects .add(__name)19                self.used_effects .add(name)
21                return self.__apply_potency__(__name)20                return self.__apply_potency__(name)
22            else:21            else:
23                raise TypeError("Effect is depleted.")22                raise TypeError("Effect is depleted.")
24    23    
n25    def __add__(self, __other) -> Any:n24    def __add__(self, other):
26        if self.used:25        if self.used:
27            raise TypeError("Potion is now part of something bigger than itself.")26            raise TypeError("Potion is now part of something bigger than itself.")
28        27        
n29        self.used_effects .update(__other.used)n28        self.used_effects .update(other.used)
30        self.duration = max(self.duration, __other.duration)29        self.duration = max(self.duration, other.duration)
31        for effect in __other.effects:30        for effect in other.effects:
32            if effect in self.effects:31            if effect in self.effects:
n33                self.potency[effect] += __other.potency[effect]n32                self.potency[effect] += other.potency[effect]
34            else:33            else:
n35                self.effects[effect] = __other.effects[effect]n34                self.effects[effect] = other.effects[effect]
36        35        
37        self.used = True36        self.used = True
38        return self37        return self
39    38    
n40    def __sub__(self, __other) -> Any:n39    def __sub__(self, other):
41        if self.used:40        if self.used:
42            raise TypeError("Potion is now part of something bigger than itself.")41            raise TypeError("Potion is now part of something bigger than itself.")
43        42        
n44        self.used_effects .difference(__other.used)n43        self.used_effects .difference(other.used)
45        for effect in __other.effects:44        for effect in other.effects:
46            if effect in self.effects:45            if effect in self.effects:
n47                self.potency[effect] -= __other.potency[effect]n46                self.potency[effect] -= other.potency[effect]
48            else:47            else:
49                raise TypeError(f"Effect \"{effect}\" not present.")48                raise TypeError(f"Effect \"{effect}\" not present.")
5049
51        self.__delete_removed_effects__()50        self.__delete_removed_effects__()
5251
53        self.used = True52        self.used = True
54        return self53        return self
55    54    
n56    def __mul__(self, __number) -> Any:n55    def __mul__(self, number):
57        if self.used:56        if self.used:
58            raise TypeError("Potion is now part of something bigger than itself.")57            raise TypeError("Potion is now part of something bigger than itself.")
59        58        
60        for effect in self.potency:59        for effect in self.potency:
n61            self.potency[effect] *= __numbern60            self.potency[effect] *= number
62            if (self.potency[effect] - math.floor(self.potency[effect])) > 0.5:61            if (self.potency[effect] - math.floor(self.potency[effect])) > 0.5:
63                self.potency[effect] = math.ceil(self.potency[effect])62                self.potency[effect] = math.ceil(self.potency[effect])
64            else:63            else:
65                self.potency[effect] = math.floor(self.potency[effect])64                self.potency[effect] = math.floor(self.potency[effect])
6665
67        self.__delete_removed_effects__()   66        self.__delete_removed_effects__()   
6867
69        self.used = True    68        self.used = True    
70        return self69        return self
71    70    
n72    def __truediv__ (self, __number : int) -> Any:n71    def __truediv__ (self, number : int):
73        if self.used:72        if self.used:
74            raise TypeError("Potion is now part of something bigger than itself.")73            raise TypeError("Potion is now part of something bigger than itself.")
75        74        
76        temp_potion = Potion(effects=self.effects, duration=self.duration)75        temp_potion = Potion(effects=self.effects, duration=self.duration)
77        temp_potion.potency = self.potency76        temp_potion.potency = self.potency
n78        temp_potion = temp_potion * (1 / __number)n77        temp_potion = temp_potion * (1 / number)
79        temp_potion.__delete_removed_effects__()78        temp_potion.__delete_removed_effects__()
8079
81        self.used = True80        self.used = True
n82        return [temp_potion for _ in range(__number)]n81        return [temp_potion for _ in range(number)]
8382
n84    def __eq__(self, __other: object) -> bool:n83    def __eq__(self, other: object) -> bool:
85        if self.__total_potency__() != __other.__total_potency__():84        if self.__total_potency__() != other.__total_potency__():
86            return False85            return False
8786
n88        return self.__compare__effects__(__other)n87        return self.__compare__effects__(other)
89    88    
n90    def __lt__(self, __other: object) -> bool:n89    def __lt__(self, other: object) -> bool:
91        return self.__total_potency__() < __other.__total_potency__()90        return self.__total_potency__() < other.__total_potency__()
92    91    
n93    def __rt__(self, __other: object) -> bool:n92    def __rt__(self, other: object) -> bool:
94        return self.__total_potency__() > __other.__total_potency__()93        return self.__total_potency__() > other.__total_potency__()
95    94    
n96    def __apply_potency__(self, __name) -> Any:n95    def __apply_potency__(self, name):
97        def apply_potion(target) -> Any:96        def apply_potion(target):
98            for _ in range(self.potency[__name]):97            for _ in range(self.potency[name]):
99                self.effects[__name](target)98                self.effects[name](target)
100            #return target99            #return target
101        return apply_potion100        return apply_potion
102    101    
103    def __delete_removed_effects__(self) -> None:102    def __delete_removed_effects__(self) -> None:
104        #self.effects = {effect:self.effects[effects] for effect in self.effects if self.potency[effect] > 0}103        #self.effects = {effect:self.effects[effects] for effect in self.effects if self.potency[effect] > 0}
105        #self.potency = {effect:self.potency[effects] for effect in self.potency if effect in self.effect}104        #self.potency = {effect:self.potency[effects] for effect in self.potency if effect in self.effect}
106    105    
107        for effect in self.potency:106        for effect in self.potency:
108            if self.potency[effect] <= 0:107            if self.potency[effect] <= 0:
109                self.effects.pop(effect)108                self.effects.pop(effect)
110                self.potency[effect] = 0109                self.potency[effect] = 0
111110
112        self.potency = {effect:self.potency[effect] for effect in self.effects}111        self.potency = {effect:self.potency[effect] for effect in self.effects}
113112
114    def __total_potency__(self) -> int:113    def __total_potency__(self) -> int:
115        return sum([self.potency[effect] for effect in self.potency])114        return sum([self.potency[effect] for effect in self.potency])
116    115    
117    def __compare__effects__(self, __other):116    def __compare__effects__(self, __other):
118        for effect in self.effects:117        for effect in self.effects:
119            if effect not in __other.effects:118            if effect not in __other.effects:
120                return False119                return False
121            120            
122        return True121        return True
123122
124def calculate_molecular_mass(name : str) -> int:123def calculate_molecular_mass(name : str) -> int:
125    return sum(ord(symbol) for symbol in name)124    return sum(ord(symbol) for symbol in name)
126125
127class ГоспожатаПоХимия:126class ГоспожатаПоХимия:
128127
129    def __init__(self) -> None:128    def __init__(self) -> None:
130        self.potion_effects = dict()129        self.potion_effects = dict()
131        self.original_targets = dict()130        self.original_targets = dict()
132        self.affected_targets = set()131        self.affected_targets = set()
n133        passn
134        132        
135    def apply(self, target, potion : Potion) -> None:133    def apply(self, target, potion : Potion) -> None:
136        if potion.used:134        if potion.used:
137            raise TypeError("Potion is depleted.")135            raise TypeError("Potion is depleted.")
138        136        
139        self.affected_targets.add(target)137        self.affected_targets.add(target)
140        original_target = copy.deepcopy(target)138        original_target = copy.deepcopy(target)
141        self.original_targets[id(target)] = original_target139        self.original_targets[id(target)] = original_target
142        if id(target) not in self.potion_effects:140        if id(target) not in self.potion_effects:
143            self.potion_effects[id(target)] = [potion]141            self.potion_effects[id(target)] = [potion]
144        else:142        else:
145            self.potion_effects[id(target)].append(potion)143            self.potion_effects[id(target)].append(potion)
146144
n147 n
148        for effect in potion.effects:145        for effect in potion.effects:
149            potion.effects[effect](target)146            potion.effects[effect](target)
150            147            
151        potion.used = True148        potion.used = True
152149
153    def tick(self) -> None:150    def tick(self) -> None:
154        for target in self.affected_targets:151        for target in self.affected_targets:
n155           n
156            flag = False152            flag = False
t157            potion : Potiont
158            for potion in self.potion_effects[id(target)]:153            for potion in self.potion_effects[id(target)]:
159                if potion.duration > 0:154                if potion.duration > 0:
160                    potion.duration -= 1155                    potion.duration -= 1
161                else:156                else:
162                    flag = True157                    flag = True
163            if flag:158            if flag:
164                self.potion_effects[id(target)] = [potion for potion in self.potion_effects[id(target)] if potion.duration > 0]159                self.potion_effects[id(target)] = [potion for potion in self.potion_effects[id(target)] if potion.duration > 0]
165                temp_target = copy.deepcopy(self.original_targets[id(target)])160                temp_target = copy.deepcopy(self.original_targets[id(target)])
166                for potion in self.potion_effects[id(target)]:161                for potion in self.potion_effects[id(target)]:
167                    potion.used = False162                    potion.used = False
168                    self.apply(temp_target, potion)163                    self.apply(temp_target, potion)
169                target = temp_target164                target = temp_target
170165
171166
172                    167                    
173  168  
174"""169"""
175170
176effects = {'grow': lambda target: setattr(target, 'size', target.size*2)}171effects = {'grow': lambda target: setattr(target, 'size', target.size*2)}
177172
178class Target:173class Target:
179174
180    def __init__(self) -> None:175    def __init__(self) -> None:
181        self.size = 5176        self.size = 5
182177
183class TestTarget:178class TestTarget:
184    def __init__(self, x , y, size) -> None:179    def __init__(self, x , y, size) -> None:
185        self.x = x180        self.x = x
186        self.y = y181        self.y = y
187        self.size = size182        self.size = size
188183
189target = Target()184target = Target()
190185
191grow = Potion(effects=effects, duration=3)186grow = Potion(effects=effects, duration=3)
192print(target.size)187print(target.size)
193narco = ГоспожатаПоХимия()188narco = ГоспожатаПоХимия()
194narco.apply(target, grow)189narco.apply(target, grow)
195190
196print(target.size)191print(target.size)
197narco.tick()192narco.tick()
198print(target.size)193print(target.size)
199narco.tick()194narco.tick()
200print(target.size)195print(target.size)
201narco.tick()196narco.tick()
202print(target.size)197print(target.size)
203narco.tick()198narco.tick()
204print(target.size)199print(target.size)
205narco.tick()200narco.tick()
206print(target.size)201print(target.size)
207202
208203
209teleport_potion204teleport_potion
210combined_potion = teleport_potion + grow_potion205combined_potion = teleport_potion + grow_potion
211 206 
212target = TestTarget(1, 1, 1)207target = TestTarget(1, 1, 1)
213 208 
214combined_potion.teleport(target)209combined_potion.teleport(target)
215combined_potion.grow(target)210combined_potion.grow(target)
216 211 
217"""212"""
218213
219#target.size = 5214#target.size = 5
220#grow = Potion(effects=effects, duration=2) * 3215#grow = Potion(effects=effects, duration=2) * 3
221#grow.grow(target)216#grow.grow(target)
222#print(target.size)217#print(target.size)
223218
224#target.size = 5219#target.size = 5
225#grow = Potion(effects=effects, duration=2) * 3220#grow = Potion(effects=effects, duration=2) * 3
226#grow = grow * 0.33221#grow = grow * 0.33
227#grow.grow(target)222#grow.grow(target)
228#print(target.size)223#print(target.size)
229224
230#target.size = 5225#target.size = 5
231#grow = Potion(effects=effects, duration=2) * 3226#grow = Potion(effects=effects, duration=2) * 3
232#grow = grow - Potion(effects=effects, duration=2)227#grow = grow - Potion(effects=effects, duration=2)
233#grow = grow - Potion(effects=effects, duration=2)228#grow = grow - Potion(effects=effects, duration=2)
234#grow = grow - Potion(effects=effects, duration=2)229#grow = grow - Potion(effects=effects, duration=2)
235#grow.grow(target)230#grow.grow(target)
236#print(target.size)231#print(target.size)
237232
238233
239#grow = Potion(effects=effects, duration=2)234#grow = Potion(effects=effects, duration=2)
240#grow.potency["grow"] = 4235#grow.potency["grow"] = 4
241236
242#small_grow ,_= grow / 2237#small_grow ,_= grow / 2
243#small_grow.grow(target)238#small_grow.grow(target)
244#print(target.size)239#print(target.size)
245240
246#grow = Potion(effects=effects, duration=2)241#grow = Potion(effects=effects, duration=2)
247#grow2 = Potion(effects=effects, duration=2)242#grow2 = Potion(effects=effects, duration=2)
248#grow2.potency["grow"] = 1243#grow2.potency["grow"] = 1
249#print(grow == grow2)244#print(grow == grow2)
250245
251246
252#d = { "d":3454, "22":3456, "agds":5345, "A":456, "X":4567, "CCCCCCCCCCCCCCCCCCC":56}247#d = { "d":3454, "22":3456, "agds":5345, "A":456, "X":4567, "CCCCCCCCCCCCCCCCCCC":56}
253#d={k:d[k] for k in sorted(d,key=calculate_molecular_mass)}248#d={k:d[k] for k in sorted(d,key=calculate_molecular_mass)}
254#print(d)249#print(d)
255250
256#target = Target()251#target = Target()
257#target2 = copy.copy(target)252#target2 = copy.copy(target)
258#print(target.size, target2.size)253#print(target.size, target2.size)
259#target2.size = 10254#target2.size = 10
260#print(target.size, target2.size)255#print(target.size, target2.size)
261256
262257
263258
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op