Develop a subroutine that calculates the resource extraction progress of a mining drone on an asteroid survey grid.
The subroutine should:
- have a sensible identifier
- take a 2D array named
surveyGrid as a parameter
- work out and output how many resources have already been extracted (represented by the character
'X' in the grid)
- work out how many remaining unextracted resources (represented by the character
'R') are left and:
- if 0, then output
'Fully depleted'
- if 1, 2, or 3, then output
'Resources low'