Closed orangejuiceplz closed 3 months ago
Destiny does NOT get to write code 😭🙏
dude i fucking hate you why can't i write my own code smh
i added some potential error handling. it seems to work. take a look at it i guess?
was late on that sorry. lookin' good for an amateur. feel free to merge
okay
hi i optimized your code for you
using
_slots__
in theCMatrix
class:__slots__
is a memory optimization technique in pythonoptimized
resize_screen
function with list comprehensions:matrix = [[CMatrix() for _ in range(COLS)] for _ in range(LINES + 1)]
creates the entire matrix in a single line, which is typically faster than nested loopsprecomputing (is this even a word?) values in the main loop:
update_delay = args.u * 0.01
) are calculated once before the loop startsis_async = args.a
) are also precomputed, which can make conditional checks in the loop slightly faster.simplifying conditional statements:
bold_style = curses.A_BOLD if args.b or args.B else 0
precomputes the bold style instead of checking it repeatedlyvariable naming and usage:
cell = matrix[i][j]
in the drawing loop avoids repeated indexing of the matrix.its just a slight overview