From 10f0555011848518e812ec66d8a3e62c07661dba Mon Sep 17 00:00:00 2001 From: edipretoro Date: Wed, 15 Jul 2026 21:06:11 +0200 Subject: [PATCH] Adding a rank attribute to the Counter class and update initialization of our counters --- noid.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/noid.py b/noid.py index e992626..4428752 100644 --- a/noid.py +++ b/noid.py @@ -7,6 +7,7 @@ from typing import ClassVar @dataclass class Counter(): + rank: int top: int value: int @@ -92,11 +93,13 @@ class Minter(Persistent): maxcounters = 293 self.percounter = int(self.oatop / maxcounters + 1) t = self.oatop + n = 0 while t > 0: top = self.percounter if t >= self.percounter else t - c = Counter(top=top, value=0) + c = Counter(top=top, value=0, rank=n) self.active_counters.append(c) t -= self.percounter + n += 1 def _n2xdig(self, num) -> str: # 1. Initialize s to ''