move snowflake logic from generated JS to turtle api, allowing random