08-10-2020, 04:02 PM
(This post was last modified: 08-10-2020, 04:33 PM by dale walton.)
Version 1.0.2
Problem with Line of Site
(define "Jumping"
(forEach Piece
(move
(from)
(to (sites LineOfSight Farthest at:(from)))
)
)
)
Attached see a picture of the result. Correct if there is an empty further along the line, but incorrect if there is not another empty in the line.
Update:
The below solves it. Main problem is the need for good documentation, but the if:(is Empty (to)) should be the default, so that if it is not wanted the role for the piece can be specified instead:
(define "Jumping"
(forEach Piece
(move
(from)
(to (sites LineOfSight Farthest at:(from))
if:(is Empty (to))
)
)
)
)
Problem with Line of Site
(define "Jumping"
(forEach Piece
(move
(from)
(to (sites LineOfSight Farthest at:(from)))
)
)
)
Attached see a picture of the result. Correct if there is an empty further along the line, but incorrect if there is not another empty in the line.
Update:
The below solves it. Main problem is the need for good documentation, but the if:(is Empty (to)) should be the default, so that if it is not wanted the role for the piece can be specified instead:
(define "Jumping"
(forEach Piece
(move
(from)
(to (sites LineOfSight Farthest at:(from))
if:(is Empty (to))
)
)
)
)