Dragging the circle and letting go of it will make it snap to the nearest square.
I would make a boundary for the grid, but the purpose of this is to show how it's done. Adding other things to this would just make it more confusing to read. The whole system is pretty much done in a single block/line.