fix: Correct sequence generation by using previous number in PatternRule

This commit is contained in:
Andreas Koepf (aider) 2025-01-23 13:54:11 +01:00
parent 1bae1d5c4d
commit 8a78d20fad

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] # Start with current number
result = sequence[position - 1] # Start with previous number
for op, param in zip(self.operations, self.parameters):
if op == Operation.ADD: