18
Imtiaz Rahi
Last seen 2 months ago
Member for 4 years, 10 months, 18 days
Difficulty Normal
like the idea how units are losing health with hit.
Also, in fight how units are swapped.
Thanks for summing up all the good ideas.
More
love it. so much to learn just looking at your solution.
Nice lambda use and getattr and multiplication of true/false with 's'.
not to mention, use of strftime.
+3 from me.
More
Have you thought about using intersection between set of node importance
based users and node connections?
You are in the right path and but it certainly can be improved.
BTW, variable naming is good and I was able to follow your code due to that.
More
Original solution [here](https://py.checkio.org/mission/node-crucial/publications/imtiaz.rahi/python-3/pretty-tricky/).
More
well done. better to put the import outside function, at the top.
More
nice and clear solution. "_**result += defenders & pawns**_" will improve it further.
More
well done. you returned twice, not needed.
def __new__(cls, name):
if cls._unique is None:
cls._unique = _SingleTon(name)
return cls._unique
More
nice one-liner solution. No need to append space in list comprehension
code. " ".join(list) will give you desired result.
More
Why put vampirism into Warrior (super class)?
It's a specialty of Vampire (sub class).
Thus Vampire class should override hit and make health increment there. Right?
More
cool. I like the way you have done it. BTW, equivalence can be defined like
{ "equivalence": x == y }
right ?
IMHO, exclusive also needs attention.
More
Looks great. What is the purpose of army_number?
More
well done.
if my_str.find(first_savior) != -1 or my_str.find(second_savior) != -1 : safe += 1
This piece of code can be made more pythonistic. Python can do boolean arithmetic.
More
nice solution. But you don't need numpy.arange to get sun angle. Simple multiplication would do it.
mins-minutes("6:00") * 0.25
More
Please consider the following improvements suggestions.
1. Better variable naming will improve code readability
e.g. arm_amount could have a different name to improve reading code in
Battle.fights function
2. Use instance variable in classes as much as possible to avoid side
effects (Warrior, Knight
More
replace('right', 'left') will replace all occurrences of right, no need to use 'if'.
When 'if' is used, then just append or set 'left'.
count is not needed as I can see it's only purpose is to know when add comma.
could have just appended comma after each item and when all is done, remove the last
More
Too much coding done. Python provides features to solve it with lot less
coding.
split the date and time (space) parts and then date string split using DOT
and time string split using COLON.
Use one function to strip leading zeroes. Then you just need to format hour
and minute string as required.
d
More