From ebe88b130fa830b572f83a7fb7ac190a37f70c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 19 Jul 2017 19:56:09 +0200 Subject: Implement game --- turtetris_master/led_output.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'turtetris_master/led_output.py') diff --git a/turtetris_master/led_output.py b/turtetris_master/led_output.py index 443c44f..1b3c435 100644 --- a/turtetris_master/led_output.py +++ b/turtetris_master/led_output.py @@ -29,3 +29,9 @@ class Matrix: if x < 0 or x > 11 or y < 0 or y > 9: raise Exception('Pixel out of matrix') self.__mat__[y][x] = color + + def fill(self, color): + "Fill whole matrix with given color" + for x in range(self.width): + for y in range(self.height): + self.pixel(x, y, color) -- cgit v1.2.3