On the Subject of Sudoku

WE ARE DROWNING WITH THIS ONE 🗣️🔥🔥

Module contains the face of Teacher Sudoku.

If you selected the module, you can safely deselect it when either there's no text on the top of Sudoku's head or the last symbol is *.

Getting N

Getting the Configuration Array

First and second element: Get the numbers from the digits on the Sudoku's face. First number corresponds to first digit in reading order.

0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24

Third element: use the positions in the table. Name them p0 and p1, where p0 < p1. 10*p0 - p0*(p0-1)/2 + p1 - 1 is your element.

0 1
2 3 4 5
6 7 8 9
10 11

Fourth and fifth elements: use values of digits from Sudoku's face, subtract 1 from both of them. If second digit is bigger than first, decrement it.

Converting

Use this formula: N = (((G[0]*25+G[1])*66+G[2])*9+G[3])*8+G[4], where G is configuration array.

Decrypting N

Take N modulo 465920.
Represent new value of N like 256P + Q, where

  • 0 ≤ P < 1819,
  • 0 ≤ Q < 256.

To decrypt P:

  • Start with S = [], X = 0, N = 3. Set function C(v,w) = v!/(w!(v-w)!)
  • While N ≥ 0:
    • If P < C(15-X,N): add X to S and decrement N. Else, decrease P by C(15-X,N).
    • Increment X.

S will have 4 distinct values after this algorithm. These are non-empty zero-indexed positions.

To decrypt Q:

Represent Q in base-4, then add 1 to each digit. These are digits in determined positions.

Solving the module

Solve the sudoku puzzle. Take center 2x2 square, subtract 1 from every cell. Convert top and bottom row of a square from base-4 to base-10 to get two numbers between 0 and 15. Submit them in this manner:

  • First number: select the module, when (total time on seconds) modulo 16 is your number.
  • Second number: deselect the module, when your number is shown.