This commit is contained in:
2026-03-31 12:11:37 +05:00
parent 0a6acc6bce
commit 6500580d75
14 changed files with 632 additions and 10 deletions

View File

@@ -115,7 +115,6 @@ namespace REG_MARK_LIB
}
private static long GetMarkIndex(string mark)
{
// Извлекаем части: A 123 BC 77
char l1 = mark[0];
int num = int.Parse(mark.Substring(1, 3));
char l2 = mark[4];
@@ -126,14 +125,11 @@ namespace REG_MARK_LIB
int i2 = Array.IndexOf(letters, l2);
int i3 = Array.IndexOf(letters, l3);
// Считаем вес номера внутри региона
// Порядок множителей (1000, 12) определяет "скорость" вращения символов
long index = num
+ (long)i1 * 1000
+ (long)i3 * 1000 * 12
+ (long)i2 * 1000 * 12 * 12;
// Добавляем вес региона (в одном регионе 12*12*12*1000 = 1 728 000 номеров)
return index + (long)region * 1728000;
}
@@ -144,7 +140,6 @@ namespace REG_MARK_LIB
long index1 = GetMarkIndex(mark1.ToUpper());
long index2 = GetMarkIndex(mark2.ToUpper());
// Возвращаем разницу (включая обе границы)
return (int)Math.Abs(index2 - index1) + 1;
}
}