move a piece down (fall one square) if it can be moved
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ip), | intent(in) | :: | i |
piece number |
||
| logical, | intent(out) | :: | moved |
if it was actually movec |
subroutine move_piece_down(i, moved) !! move a piece down (fall one square) if it can be moved integer(ip),intent(in) :: i !! piece number logical,intent(out) :: moved !! if it was actually movec moved = .false. if (size(get_pieces_below(i))==0) then ! can only move if nothing below if (istart_array(i,3)>1 .and. iend_array(i,3)>1) then istart_array(i,3) = istart_array(i,3) - 1 iend_array(i,3) = iend_array(i,3) - 1 moved = .true. call update_array() end if end if end subroutine move_piece_down