How much sanity checking is required for function inputs?

Christopher Reimer christopher_reimer at icloud.com
Thu Apr 21 23:11:10 EDT 2016


On 4/21/2016 7:10 PM, Ethan Furman wrote:
>> I do plan to incorporate a sanity test in each Piece class to validate
>> the initial position value. Pawns have 16 specific positions. Bishop,
>> Knight and Rook each have four specific positions. King and Queen each
>> have two specific positions. An invalid value will raise an exception.
>
> This will make it so you cannot use your PieceFactory for custom setups.
>

The sanity check won't be in the PieceFactory, but in the Piece class as 
an interface and each Piece subclass will implement the correct 
positions for comparison.

Thank you,

Chris R.



More information about the Python-list mailing list