49
Awesome Team
Philippe Cholet
https://github.com/Philippe-Cholet
Last seen 2 hours ago
Member for 6 years, 3 months, 11 days
Difficulty Advanced
I was a math teacher in France for two years. I'm currently reconverting to IT, I'm here to improve my Python skills, and practice English.
Others units than Warrior are subclasses of Warrior, so you don't have to copy is_alive property each time, only one time in the Warrior class.
If you think Army class like a list, consider (It wasn't my first idea but it's realy great)
class Army(list):
#Each instance of Army is a lis
More
You can define methods in your classes for simplify your code. Your fight function has become ugly from my perspective. Details of a specific unit "have to" be in the class of the specific unit. Imagine your fight function with an hundred of differents units. :-D It's only my opinion, I only make cl
More
I have the game on my computer. And it’s really amazing to be able to solve a 20x20 grid. But instead of a list of lights like on_panels, I prefer a string input like “00001 01000 00110 00100 00000” vs [5, 7, 13, 14, 18] because my game don’t show numbers. This other algorithm return a string of the
More
### I am particularly proud of my partition generator. _I think it is really beautiful thing!_
I noticed with other codes that "test(i,j)" can be replaced by "(i>j)-(iMore
I don't like it, why sort all the list when you just want min or max? Bad computational complexity here : if n is the length of the list/iterable... O(n log n) instead of O(n) when you just look the iterable's elements one by one.
For me, the purpose here is not use a powerful function like sorted.
More