fix: Correct PatternRule.apply() to use current sequence element

This commit is contained in:
Andreas Koepf (aider) 2025-01-23 13:53:30 +01:00
parent 26bc1ac1c1
commit 1bae1d5c4d

View file

@ -46,7 +46,7 @@ class PatternRule:
def apply(self, sequence: List[int], position: int) -> int:
"""Apply the rule to generate the next number"""
result = sequence[position - 1] # Start with previous number
result = sequence[position] # Start with current number
for op, param in zip(self.operations, self.parameters):
if op == Operation.ADD: