Movement effeciency critique

Hi all!

New to the game and to writing code really.

Wanted to ask for a critique on this function getgrass(smooth)

while(True):

`for i in range(get_world_size() -1):`

	`if can_harvest():`

		`harvest()`

	`move(East)`

`if can_harvest():`

	`harvest()`

`move(North)`

`for i in range(get_world_size() -1):`

	`if can_harvest():`

		`harvest()`

	`move(West)`

`if can_harvest():`

	`harvest()`

`move(North)`

basically my original getgrass function was waisting time flying back to the first column each time so now it snakes up left to right.

but can it be written smoother / shorter?

https://preview.redd.it/viiw02j7i7dg1.png?width=2399&format=png&auto=webp&s=01d032cf1b66b808c823e9be98c56e72506ba609

Posted Jan 14, 2026, 12:07 AM UTC

35
Loading comments…