not_tree Function

pure function not_tree(i, j)

returns true if the cell isn't a tree

Arguments

Type IntentOptional Attributes Name
integer(kind=ip), intent(in) :: i

coordinates

integer(kind=ip), intent(in) :: j

coordinates

Return Value logical


Called by

proc~~not_tree~~CalledByGraph proc~not_tree problem_23::not_tree proc~count_adjacent problem_23::count_adjacent proc~count_adjacent->proc~not_tree proc~go~5 problem_23::go proc~go~5->proc~count_adjacent program~problem_23 problem_23 program~problem_23->proc~go~5

Source Code

    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