Function snake_sdk::split

source ·
pub fn split()
Expand description

If the snake has a length of at least 9, it is eligible to split into two. The snake is split into three parts (the middle is rounded up, the rest down). The first part will remain as the original snake. The middle part will be lost and turn into poison. The end will become a new snake. The snake runtime will be forked, and both new snakes will continue to run independently. You can use get_id to determine which snake is now running.