Knight's tour: Difference between revisions

m
→‎{{header|REXX}}: changed a comment, simplified a couple of DO loops. -- ~~~~
m (→‎{{header|REXX}}: updated the chessboard presentation. -- ~~~~)
m (→‎{{header|REXX}}: changed a comment, simplified a couple of DO loops. -- ~~~~)
Line 2,700:
Kf = '1 2 2 1 -1 -2 -2 -1' /* " "file" " " " " */
 
do i=1 for words(Kr)8 /*legal knight moves*/
Kr.i = word(Kr,i); Kf.i = word(Kf,i)
end /*i*/
Line 2,710:
move: procedure expose @. Kr. Kf. N NN; parse arg ?,r,f
 
do t=1 for N8; nr=r+Kr.t; nf=f+Kf.t
if @.nr.nf==0 then do; @.nr.nf=?
if ?==NN then return 1