Optimization of my Program

Question:
This is less of question and more of a request for anyone who’s bored, since I want efficient and readable code but am too lazy to debug the 800 lines.

Repl link:
Storyshift/main.py - Storyshift - Replit

Note that my variable naming is either counter-intuitive or directly to the point, so just
ask if anything confuses you. I’m mainly hoping for a reworking of some of the battle functions and the organization of the code. Also, whoever does do it will get credit once I build this on an actual IDLE (this version is a basic demo), so idk, just enjoy.

there is an extension on replit called prettier. Try to use that and see if you are satisfied with the results.

It doesn’t appear to have changed anything at all. My assumption would be that replit’s formatter has a near identical process. I guess the optimal extension for this sort of things would be an AI that runs it’s own code and checks to see if it works the same (same data/image output compared to original), though that would be millions of dollars and better than current existing AI.

Personally not suggested for this method, but you can ask replit’s AI to help, if you want to change the code fast

prettier is not for Python. The equivalent is black, but it can’t do any actual refactoring. The most I have time for is to give you a blackened version of the code Advanced AI gave me, but it has file memory restrictions (the Basic AI doesn’t have such limits but it refuses to optimise such a long file): I had to give it a minified version of the code and still it was too large. And I’m not going to give it the code in chunks: it already took so long for it to process just this first part.

You might get someone if you open a bounty.

4 Likes

Sadly, I don’t have funds in Replit, as this is just something I do for fun. However, the first snippet you posted gives me a good example to base the rest on, so thanks!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.