otrego / clamshell

Clamshell is a library of Golang functions and tools for the game go
Apache License 2.0
18 stars 11 forks source link

Add validation to board.SetPlacements #220

Open artasparks opened 3 years ago

artasparks commented 3 years ago

We should add validation to board.SetPlacements. At present, SetPlacements looks like:

func (b *Board) SetPlacements(ml move.List) error {
    for _, m := range ml {
        b.setColor(m)
    }
    return nil
}

However, this has the potential to created invalid positions (i.e., captures left on the board). So, once the placements are set, we should ensure the board position is still valid.