Wiimmfi/Nice ID

From Custom Mario Kart
Jump to: navigation, search

Nice ID is a concept of Wiimmfi to make long numeric identifiers easier to read and to remember. A Nice ID consists always of 2 letters followed by 2 digits. So 26*26*10*10=67600 different nice ids are available. They are used cyclic. A reset to AA00 happens only every few weeks.

C algorithm

The following algorithm shows, how a numeric id is translated to a Nice ID. The algorithm includes, that the number is truncated by modulo 67600.

  char nice[5];
  nice[0] = 'A' + id / 2600 % 26;
  nice[1] = 'A' + id /  100 % 26;
  nice[2] = '0' + id /   10 % 10;
  nice[3] = '0' + id        % 10;
  nice[4] = 0;