Pattern Grid Algorithm | ScratchStats