View on GitHub

style-codes

Resources for INCOM Style Codes

Style Codes (Version 2)

This page describes in detail the format used to encode a style judgement into a style code. It refers to the Version 2 of the Style Codes (supporting half points in the Technical Coefficients), in use since September 2025. For a description of the old version (supporting only integer points), see Style Codes (Version 1).

Requirements

The encoding was designed to produce a representation (alphanumeric word) of a style judgement with the following requirements:

Representation

Style codes follow this format:

abXXcdeYZ

where:

The representation is case-insensitive.

The format and the encoding algorithm is chosen with the following considerations:

The Algorithm

A style judgement consists in 7 scores between 0 and 3 (with 0.5 interval), a SOG score (between 0 and 3), and a PEN score (between 0 and 20).

SOG and PEN are encoded in the fields Y and Z respectively. If PEN is 10 or larger, then letters are used, with a=1, b=2, …, h=17, i is excluded, j=18, k=19, l is excluded, m=20. Z is omitted if PEN is zero, and Y is omitted if both SOG and PEN are zero.

The other 7 scores are encoded in the first part of the code, with format abXXcde. The numeric field XX contains the total of assigned half points in these categories, so only 6 scores need to be encoded in the letter fields, the seventh being the difference between the total and the sum of the other six. The BAS score is chosen as the one to be encoded in this way.

The fields from b to e are optional.

If SOG or PEN are different from zero (so Y cannot be omitted), and the one-letter format is being used, then c takes the value z to be used as a separator between XX and Y to prevent ambiguity.

The letter fields from a to e are computed by encoding a certain numeric value in base 23, using the following 23 letters as the digits: zyxwvutsrqpnmkjhgfedcba (z = 0, y = 1, x = 2, …), so that the field a is the least significant digit and e is the most significant digit, and omitting most significant digits if the value is 0 (z).

The numeric value is computed from the values of the technical coefficients excluding BAS, so that the value is unique for all combinations of the technical coefficients. The formula for that value produces a smaller value for more common judgements (low values of MOV, GCC and DIN, and zero COM, SAPD and DIF). In the following, // is integer division and % is the remainder of integer division.

mov_low_digit = (COM * 2) % 3
mov_high_digit = (COM * 2) // 3
din_low_digit = (DIN * 2) % 3
din_high_digit = (DIN * 2) // 3
gcc_low_digit = (GCC * 2) % 3
gcc_high_digit = (GCC * 2) // 3

value = mov_low_digit + \
    din_low_digit * 3 + \
    gcc_low_digit * 3 * 3 + \
    mov_high_digit * 3 * 3 * 3 + \
    din_high_digit * 3 * 3 * 3 * 3 + \
    gcc_high_digit * 3 * 3 * 3 * 3 * 3 + \
    com_int * 3 * 3 * 3 * 3 * 3 * 3 + \
    sapd_int * 3 * 3 * 3 * 3 * 3 * 3 * 7 + \
    dif_int * 3 * 3 * 3 * 3 * 3 * 3 * 7 * 7

Reference implementations