Question: can you please help me with this. The code is alreeady written and just missing a function. https://sites.google.com/site/uiccs141/lab-ta-info/lab-6-coin-swap You will implement the function moveNotValid to

can you please help me with this. The code is alreeady written and just missing a function.

https://sites.google.com/site/uiccs141/lab-ta-info/lab-6-coin-swap

You will implement the function moveNotValid to validate the moves for the swap. The function should address the three conditions stated in the comments above:

Return true (move is not valid) if any of the following conditions are true: 1. X is attempting to move to the left 2. O is attempting to move to the right 3. The destination location is not empty else return false (move IS valid)

The first two parts of the lab will grade you on the ability to write the function which is able to handle these cases returning true or false.

For the Extra Credit:

Your messages will be a bit more customized:

Instead of displaying a general message like Invalid move, please retry.

If/when a move attempts to move a piece in an invalid direction Display message: *** You cannot move that piece that direction. Invalid move, please retry.

The user attempts to move into a non-blank destination Display message: *** Destination square is not empty. Invalid move, please retry.

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!