On the Subject of The cRule

Isn't this whole game pretty cruel anyway?

This module is based on Wolfram's cellular automata. This module displays four rows of squares. From top to bottom, the rows contain 8, 7, 6, and 5 squares. 10 squares in the grid will be colored one of the three primary colors (red, green, or blue), one of the three secondary colors (yellow, cyan, and magenta), white (representing a mixture of all three primary colors), or black (representing an absence of all three primary colors). These cells cannot change color. All other squares on the module will initially be gray.

A Rule Number represents a cellular automaton. The goal of this module is to find the colors of all four stages of the cellular automaton based off of the already filled-in squares. Whether or not a square contains a certain primary color is based on if the two adjacent squares immediately above it contain that color, as determined by that color's Rule. Coloring is additive.

The defuser can click any of the eight small colored squares in the bottom half of the module to choose a color. They can then select squares in the grid that were not pre-filled to change their color to the currently active color. When the Submit button is pressed, the module will check each square in the grid. If each square follows all three colors' Rules, then the module will solve. If any square breaks a Rule, then a strike will be incurred and the grid will reset to its initial configuration. There may be multiple solutions for a grid's initial configuration; all correct solutions will be accepted. The reset button is used to set all defuser-colored cells back to gray.

Solving the Module

Three of the pre-filled squares contain shapes. These shapes represent numbers based on the following table.

00 01 02 03 04 05 06 07
♤♤ ♤♧ ♤♢ ♤♡ ♧♤ ♧♧ ♧♢ ♧♡
08 09 10 11 12 13 14 15
♢♤ ♢♧ ♢♢ ♢♡ ♡♤ ♡♧ ♡♢ ♡♡
The Rule Number of a color can be calculated by adding its symbol's number to the sum of the digits in the serial number and taking this sum modulo 16.
If a symbol occurs on a primary color, then that color's Rule Number is the number associated with that symbol. If a symbol occurs on a secondary color, then the color not making up the secondary color will receive the symbol's associated Rule Number. Each symbol represents a different color.

Each color's Rule Number is converted to a four-digit binary number, prepending with zeroes if necessary. In reading order, the four digits in the binary number are respectively the value of a cell under cells represented by 11, 10, 01, and 00, where 1 means a cell contains the relevant primary color and 0 means the cell does not contain that color. To solve the module, color squares so that the module displays the correct behavior of the cellular automatons and click the Submit button.