Added function for setting maze state with a function of cell coordinates