Make a command line parameter CONFINE_SNAKES that is used with the snake generation option #23
Then, have two options for how to confine the snakes.
REDIRECT_CONFINED_SNAKES: When used, directions that would lead outside the confines of the fence or under ground will be impossible (their direction preference replaced with float(‘-inf’) which will make the direction impossible to select). The next best option will be chosen.
STOP_CONFINED_SNAKES: Whenever a snake chooses to go out of bounds, simply set the stop condition to True so no more blocks are generated.
Both redirect confined snakes and stop confined snakes work as they should. The redirect method makes the snakes a lot more curly and the stop method makes very linear snakes
Make a command line parameter CONFINE_SNAKES that is used with the snake generation option #23
Then, have two options for how to confine the snakes.
REDIRECT_CONFINED_SNAKES: When used, directions that would lead outside the confines of the fence or under ground will be impossible (their direction preference replaced with
float(‘-inf’)
which will make the direction impossible to select). The next best option will be chosen.STOP_CONFINED_SNAKES: Whenever a snake chooses to go out of bounds, simply set the
stop
condition to True so no more blocks are generated.