let rec getvalidxy cave = let x = Random.int (Array.length cave) in let y = Random.int (Array.length cave.(0)) in if get cave x y != WALL then (x,y) else getvalidxy cave