Knight's tour: Difference between revisions
→FORTRAN 77
Line 4,269:
if (nmove(n) .eq. 9) then
n = n - 1
nmove(n) = nmove(n) + 1
else if (goodmv (imove, nmove, n)) then
call mkmove (board, imove, jmove, nmove, n)
Line 4,588 ⟶ 4,590:
if (w .eq. 0) then
call disabl (imove(1, n1),
call disabl (imove(
call disabl (imove(
▲ imove(4,n1) = -1
jmove(4,n1) = -1▼
imove(5,n1) = -1▼
jmove(5,n1) = -1▼
▲ imove(6,n1) = -1
imove(7,n1) = -1▼
imove(8,n1) = -1▼
else
if (w .ne. w1) call disabl (imove(1, n1),
if (w .ne.
if (w .ne.
if (w .ne.
if (w .ne.
if (w .ne.
▲ if (w .ne. w4) imove(4,n1) = -1
▲ if (w .ne. w6) imove(6,n1) = -1
end if
Line 4,766 ⟶ 4,738:
integer imove, jmove
jmove = -1▼
if (1 .le. i .and. i .le. 8 .and. 1 .le. j .and. j .le. 8) then
if (board(i,j) .eq. -1) then
▲ jmove = j
end if
end if
end
C-----------------------------------------------------------------------
subroutine enable (i, j, imove, jmove)
implicit none
C Enable a potential move.
end
C-----------------------------------------------------------------------
subroutine disabl (imove, jmove)
implicit none
C Disable a potential move.
integer imove, jmove
end
|