News for hackers. Stuff that matters.
Re:Ask HN: What did you make during lockdown? by yasoob on Sunday June 21, 2020 @01:31PM (#23593569)
There is usually enough space between two chess pieces to easily fit a third one between them on these boards. So from my understanding the magnet just moves the third piece from between the two other pieces without hitting either of them.
Re:Ask HN: What did you make during lockdown? by jstanley on Sunday June 21, 2020 @02:49PM (#23594291)
I sized the squares on the board so that there would be enough room to slide a piece orthogonally between 2 other pieces, but was actually not able to make use of this property in the end.

The problem I faced was that when I had magnets that were strong enough to be reliably grabbed by the electromagnet, they were strong enough to repel each other if they got too close! I went through quite a large selection of different magnet sizes before I settled on the final one (which is 6mm diameter, 6mm tall, neodymium cylinders). They're strong enough to be grabbed by the electromagnet, and weak enough that 2 pieces can be in the centre of a square and a corner of the square without moving apart, but unfortunately still not weak enough that a piece can slide in a straight line past another piece.

When there is a piece in the way, it works out whether it would be shorter to move a piece out of the way, or to route the long way around, and picks whichever is shorter.