throwStone :: RandomGen g => Board -> g -> Either String Board
throwStone board g
    | null $ freePositions board = Left "There is no place to throw a stone."
    | otherwise = Right $ putPiece board pos Stone
    where pos = head $ shufflePositions (freePositions board) g

-- |
-- Randomly throw the given number of 'Stone's on the board.
throwStone :: RandomGen g => Board -> g -> Either String Board
throwStone board g
    | null $ freePositions board = Left "There is no place to throw a stone."
    | otherwise = Right $ putPiece board pos Stone
    where pos = head $ shufflePositions (freePositions board) g

-- |
-- Randomly throw the given number of 'Stone's on the board.
throwStone board g
    | null $ freePositions board = Left "There is no place to throw a stone."
    | otherwise = Right $ putPiece board pos Stone
    where pos = head $ shufflePositions (freePositions board) g

-- |
-- Randomly throw the given number of 'Stone's on the board.