Yes, I am very sorry about this. I do know this site should not be used as a alpha-test facility. But the include file did contain a bug that had to be fixed, and I was dealing with some apparently illogical and therefore unpredictable behavior of GAME code itself.
@Fergus: wouldn't it be better to include the application of the PHP intval operator in the implementation of piececount itself, so that it would return the expected 0 for pieces that are not on the board?
It might also be useful to apply intval to the operands of arithmetic operators such as +. (Or is that very detrimental, performance-wise?) I was really baffled by that 1 + undefined = 0.
Yes, I am very sorry about this. I do know this site should not be used as a alpha-test facility. But the include file did contain a bug that had to be fixed, and I was dealing with some apparently illogical and therefore unpredictable behavior of GAME code itself.
@Fergus: wouldn't it be better to include the application of the PHP intval operator in the implementation of piececount itself, so that it would return the expected 0 for pieces that are not on the board?
It might also be useful to apply intval to the operands of arithmetic operators such as +. (Or is that very detrimental, performance-wise?) I was really baffled by that 1 + undefined = 0.