Script for finding undefended pieces I am looking for a script/code/CQL that searches for undefended pieces in  a given position. I know that is possible to do it in the python chess library, but that is too complicated for me.

Is there any easy way?
You can use &quot;Chess Query Language&quot; for coding this, as it will be quicker to work with and easier to understand.