Thanks, the algorithm definitely took a fair amount of time to get something that worked well. The pickup items didn't really have any AI for where they were placed, as long as it was in an empty slot and not close to the snake's head so sometimes apples spawn near garbage, but it's not like garbage causes a failure state, just a minor setback so I didn't think much of it at the time.