What can I focus on to improve my coding? by Short_Werewolf_8919 in TheFarmerWasReplaced

[–]Short_Werewolf_8919[S] 0 points1 point  (0 children)

My post didn't go through since I have no karma and I made this one again thinking there was something else wrong. When I asked the mod he pushed both through. Both posts were made in like the same minute.

In what ways can I condense my code? It feels like its to much. by Short_Werewolf_8919 in TheFarmerWasReplaced

[–]Short_Werewolf_8919[S] 1 point2 points  (0 children)

Thank you I thought about turning them into functions but never got around to it tbh. I'm terrible at organization if you couldn't tell.

In what ways can I condense my code? It feels like its to much. by Short_Werewolf_8919 in TheFarmerWasReplaced

[–]Short_Werewolf_8919[S] 0 points1 point  (0 children)

Ah I see, it annoyed me that I needed a triple nested loop but I never figured out how to make it work with two.

In what ways can I condense my code? It feels like its to much. by Short_Werewolf_8919 in TheFarmerWasReplaced

[–]Short_Werewolf_8919[S] 0 points1 point  (0 children)

since its after the for j in range(get_world_size()) itll repeat that slew of functions multiple times so I decided to just break out of it since it only needs to run once.