diff --git a/wasp/apps/calc.py b/wasp/apps/calc.py index 35a2309..5860b31 100644 --- a/wasp/apps/calc.py +++ b/wasp/apps/calc.py @@ -39,6 +39,10 @@ calc = ( b'n3l5j7h9f3): - indices[0] = 3 - if (indices[1]>4): - indices[1] = 4 - button_pressed = self.fields[indices[0]][indices[1]] + if x > 4: + x = 4 + if y > 3: + y = 3 + button_pressed = fields[x + 5*y] if (button_pressed == "C"): self.output = "" elif (button_pressed == "="): @@ -96,7 +98,7 @@ class CalculatorApp(): if x == 3: draw.set_color(wasp.system.theme('accent-mid')) for y in range(4): - label = self.fields[y][x] + label = fields[x + 5*y] if (x == 0): draw.string(label, x*47+14, y*47+60) else: