## On the Subject of Four Lights

Binary turns them on...

This module consists of four bulbs labeled from 1 to 4.

Let A be a 4-digit binary number where the leftmost bulb is the most significant bit and the rightmost bulb is the least significant digit. (Lit represents a 1. Unlit represents a 0)

Let B be a 4-digit binary number where the bulb labeled 1 is the most significant bit and the bulb labeled 4 is the least significant digit.

Next, apply the solution technique related to the **FIRST** true condition. After the first press, all bulbs will turn off and all labels will disappear. Striking on this module by inputting an incorrect press will make them reappear, and you will have to redo the entire sequence.

#### If all 4 bulbs are on :

Press the labels in ascending order.

#### If all 4 bulbs are off :

Press the labels in descending order.

#### If there are as many lit bulbs as there are lit indicators and as many unlit bulbs as there are unlit indicators on the bomb :

Press the label on position x, where x is the number of lit bulbs, and press the label y, where y is the number of unlit bulbs.

#### If a single bulb is lit :

Press the label whose number is the lit bulb's position.

#### If A and B have the same value :

Press the label of the leftmost lit bulb, then the smallest label whose bulb is lit.

#### If A and B, in base 10, are greater or equal to 10 (or are represented by a letter in base 16) :

Let C be (A AND B). Press the position of the labels where you have a 1, from left to right.

Example : For A = 1010 (A in base 16) and B = 1110 (E in base 16), C = 1010, meaning you have to press the 1st and 3rd label.

#### Otherwise :

Press the lit bulbs' labels in ascending order, then the unlit bulbs' labels in descending order.