Programming
Showing 5353–5376 of 10790 resultsSorted by popularity
-
[SOLVED] algorithm game Haskell Consider the following light switching game. We begin with an n by n grid of square buttons, numbered 1n2, initially dark, as shown below (left) for n = 4. Pressing any button will cause that button to light up, along with its immediate neighbours above, below, and to its left and right in the grid. For example, the result of pressing button 11 is depicted below (middle). Subsequent button presses will continue to light up nearby buttons, or switch them back o if they are already alight. For example, the result of pressing button 15 (after button 11) is shown below (right). Note that because buttons 15 and 11 were both alight, they became dark again. Note also that the grid does not wrap around: button 15 has no eect on button 3. The aim of the puzzle, given a particular light conguration, is to nd a sequence of button-presses that will produce this conguration.
Programming $25 Add to cart