returns true if the cell isn't a tree
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ip), | intent(in) | :: | i |
coordinates |
||
| integer(kind=ip), | intent(in) | :: | j |
coordinates |
pure logical function not_tree(i,j) !! returns true if the cell isn't a tree integer(ip),intent(in) :: i,j !! coordinates if (i<1 .or. i>nrows .or. j<1 .or. j>ncols) then not_tree = .false. ! off the board, call it a tree else not_tree = array(i,j) /= '#' end if end function not_tree