will8211 / unimatrix

Python script to simulate the display from "The Matrix" in terminal. Uses half-width katakana unicode characters by default, but can use custom character sets. Accepts keyboard controls while running. Based on CMatrix.
GNU General Public License v3.0
1.75k stars 161 forks source link

Enhancement: refactor KeyHandler #19

Closed bradsbrown closed 5 years ago

bradsbrown commented 6 years ago

I started looking at a way to streamline the large elif blocks for fg and bg colors, and came up with a few other potential ideas on KeyHandler while I was at it. You're not going to hurt my feelings if you reject any or all of it, I just had an idea and thought I'd toss it out there.

will8211 commented 6 years ago

Hi, I've been thinking about this. I like it because it's clever and conforms to the DRY principle. However, the point of DRY is to make code more readable and maintainable. I'm a bit concerned that these changes will actually slightly obfuscate the meaning of the code, and make it more difficult for people to play with and contribute to...

will8211 commented 6 years ago

Would it be OK with you if I close the pull request, but go through and integrate some of your solutions here and there? Some of the changes are definite improvements, and it would be faster than telling you which parts I'd like to keep.

bradsbrown commented 6 years ago

Absolutely! It's your project. :)