Implement the following puzzle: Each square in a row of squares can be either blue or black. A square can change color only under certain conditions, as follows. The first square will change color...


Implement the following puzzle: Each square in a row of squares can be either blue or black. A square can change color only under certain conditions, as follows. The first square will change color anytime you click it. Each of the other squares will change color when you click it, but only if the preceding one is blue and all other squares before it are black.


To begin the puzzle, the user chooses a number n, between 1 and 10, by clicking a button on a keypad. Given a row of n blue squares, the user’s challenge is to make all of the squares black.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here