Used grid system to optimize neighbor selection from O(n^2) to O(n) on average YET IT IS STILL UNPLAYABLE SCRATCH TEAM MAKE YOUR PROGRAM FASTER PLEASE???????????????
I tried to make it playable on scratch, but sadly it is too much to handle even after the optimization so just use https://turbowarp.org/1081040110