01-11-2021, 04:54 PM
Hi Michael,
In Ludii we do not treat the action of clicking on a site as a "drag", however if there is a legal move that involves making a move from the clicked site and to the clicked site, we perform this move.
This is the same behaviour as placing a piece in a game like tic-tac-toe. In this case, selecting a site performs a move from this site to the same site.
In a more formal sense the rules for making moves are as follows:
1. If you drag a piece from one site to a different site, we attempt to make a move corresponding to the dragged sites.
2. If you click on a site then either:
a. If there is a legal move from that site to the same site, we make that move
b. If (a) is not true, and a piece is not selected, then we select that piece
c. If neither a. nor b. is true, we attempt to make a move between the (previously) selected site and the clicked site
In Ludii we do not treat the action of clicking on a site as a "drag", however if there is a legal move that involves making a move from the clicked site and to the clicked site, we perform this move.
This is the same behaviour as placing a piece in a game like tic-tac-toe. In this case, selecting a site performs a move from this site to the same site.
In a more formal sense the rules for making moves are as follows:
1. If you drag a piece from one site to a different site, we attempt to make a move corresponding to the dragged sites.
2. If you click on a site then either:
a. If there is a legal move from that site to the same site, we make that move
b. If (a) is not true, and a piece is not selected, then we select that piece
c. If neither a. nor b. is true, we attempt to make a move between the (previously) selected site and the clicked site