Question: * Determine whether a piece or peg placement is well-formed according to the following: * - it consists of exactly four characters * - the

* Determine whether a piece or peg placement is well-formed according to the following: * - it consists of exactly four characters * - the first character is in the range a .. l (pieces and pegs) * - the second character is in the range 1 .. 8 (columns) * - the third character is in the range A .. D (rows) * - the fourth character is in the range 0 .. 8 (if a piece) or is 0 (if a peg) * * @param piecePlacement A string describing a single piece or peg placement * @return True if the placement is well-formed
 Determine whether a placement string is well-formed: * - it consists of exactly N four-character piece placements (where N = 1 .. 15); * - each piece or peg placement is well-formed * - each piece or peg placement occurs in the correct alphabetical order (duplicate pegs can be in either order) * - no piece or red peg appears more than once in the placement * - no green, blue or yellow peg appears more than twice in the placement * * @param placement A string describing a placement of one or more pieces and pegs * @return True if the placement is well-formed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!