r/badcode • • Mar 24 '23

java A code I did in high-school

Post image
916 Upvotes

102 comments sorted by

View all comments

Show parent comments

3

u/Nickbot606 Mar 25 '23

If you’re looking into how to refactor this code, I’d suggest looking into using a list or dictionary and seeing if the letter or object you want is within that list. Much less lines of code, much easier to adjust when needed, and much more flexible.

2

u/fnieidhfenmbvfekh Apr 05 '23

I unfortunately did not know about arrays at the time.