## On the Subject of 9-Ball

Where are the pockets? How are the balls defying gravity? WHERE'S THE POOL CUE?

This module presents an array of billiard balls in a diamond formation. The 9 ball will always be central in the formation and the 1 ball will always be at the head, however the positioning of the other balls is uncertain. To solve the module you must win a game of 9-Ball according to certain rules. Potting a ball out of turn will cause a strike and reset the module.

### Step 1: Breaking the Formation

As every good billiards game begins, you need to break the formation. However, there are certain rules that determine which balls are potted during the break which are listed below (with A being the first ball in reading order, skipping over 1 and 9):

- A - If this ball is greater than 5.
- B - If ball A is greater than this one.
- C - If this ball is greater than the last digit of the serial number.
- D - If this ball is prime.
- E - If either of the adjacent balls (excluding 9) are consecutive in value to this ball.
- F - If the difference of the adjacent balls (excluding 1 and 9) is greater than 2.
- G - If neither of the adjacent balls (excluding 1 and 9) is greater than 6.
- 1 - If the last digit of the serial number is odd.
- 9 - Never.

In this step, order has no significance meaning that the valid balls can be potted in any order.

### Step 2: After the Break

After the break, the remaining balls should be potted in ascending numerical order, ending with the 9 ball.