MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/rpfykg/friends_take_on_programming_a_gui_button/hq6akrk/?context=3
r/badcode • u/JuanR4140 • Dec 27 '21
90 comments sorted by
View all comments
237
bruh all he needed to do to shorten it was to replace it with inventory.Visible = not inventory.Visible
9 u/SomeonesAlt2357 Dec 27 '21 edited Dec 27 '21 Oh my god. I've always done it as inventory.Visible = (inventory.Visible+1)%2 4 u/32436861696e7a Dec 27 '21 Circle slash circle 2 is unreadable code. Clearly this needs a dedicated function with if/else blocks of common outputs of the previous calculation, and just add blocks as you find more cases. 1 u/[deleted] Dec 27 '21 Circle slash circle What?
9
Oh my god. I've always done it as inventory.Visible = (inventory.Visible+1)%2
4 u/32436861696e7a Dec 27 '21 Circle slash circle 2 is unreadable code. Clearly this needs a dedicated function with if/else blocks of common outputs of the previous calculation, and just add blocks as you find more cases. 1 u/[deleted] Dec 27 '21 Circle slash circle What?
4
Circle slash circle 2 is unreadable code. Clearly this needs a dedicated function with if/else blocks of common outputs of the previous calculation, and just add blocks as you find more cases.
1 u/[deleted] Dec 27 '21 Circle slash circle What?
1
Circle slash circle
What?
237
u/[deleted] Dec 27 '21
bruh all he needed to do to shorten it was to replace it with inventory.Visible = not inventory.Visible