26
Bertrand BENOIT
https://bertrand-benoit.gitlab.io/
Last seen 1 month ago
Member for 4 years, 10 months, 17 days
Difficulty Advanced
Software Architect - Artificial Intelligence R&D Engineer
Lol ... you enjoyed it! Nice :)
More
Your solution is functional, good job.
You may change your connected method using the in operator and set
intersection 😉
More
May I suggest you move the if unit == opacity and return after your if/else
instructions.
More
I think your constructor miss a 'in' keyword (not in conn).
If you add and remove, may you check the opposite to return asap and then
perform the add/remove with less indentation and then more legibility.
More
If I may suggest, you could update item with a oneline if/else instruction.
You should avoid having several variables with only case variation in name,
it is prone to bug and reading error.
You may used builtin groupby function 😉
More
Hi, may I suggest:
- you should NOT put No-Warrior logic in the abstract Warrior class (there should be Defense only in Defenser etc ...)
- one of your method name is miswritten, it should be => _receive_damage
You can check my solution if you want: https://py.checkio.org/mission/straight-fight/p
More
Hi, may I suggest:
- you should NOT put No-Warrior logic in the abstract Warrior class (there should be Vampirism only in Vampire, Defense only in Defenser etc ...)
- for that you should use inheritance for attributes, and for methods
You can check my solution if you want: https://py.checkio.org/
More
Hi, may I suggest:
- you should NOT put No-Warrior logic in the abstract Warrior class (there should be Vampirism only in Vampire, Defense only in Defenser etc ...)
- for that you should use inheritance for attributes, and for methods
You can check my solution if you want: https://py.checkio.org/
More
Hi, may I suggest:
- you should NOT put No-Warrior logic in the abstract Warrior class (there
should be Vampirism only in Vampire, Defense only in Defenser etc ...)
- for that you should use inheritance for attributes, and for methods
You can check my solution if you want:
https://py.checkio.org/
More
Hi. You can use a defaultdict to avoid tje initialization with 0 😱
More
Hi, may I suggest:
- you don't need to rewrite the is_alive property which is already inherited for each unit
- you should add a max_health in each unit instead of your hard-coded dictionnary
You can check my solution if you want: https://py.checkio.org/mission/straight-fight/publications/bsquare
More
Hi, may I suggest:
- you should NOT put No-Warrior logic in the abstract Warrior class (there should be Vampirism only in Vampire, Defense only in Defenser etc ...)
- for that you should use inheritance for attributes, and for methods
You can check my solution if you want: https://py.checkio.org/
More
If I may suggest:
- you should factorize min and max (tips: use operators)
- create your own key if none is specify and avoid multiple if/else
instructions (tips: lambda expression)
More
Hi, may I suggest:
- you should NOT put No-Warrior logic in the abstract Warrior class (there should be Vampirism only in Vampire, Defense only in Defenser etc ...)
- for that you should use inheritance for attributes, and for methods
You can check my solution if you want: https://py.checkio.org/
More
Hi.
You may use Tuple instead of list, in your conv member.
You could use list comprehension in your robot function.
More