Nauč se Python > Materiály > Snake Workshop for PyLadies > Extensions > Snake extension: Infinite playground

Snake extension: Infinite playground – Řešení [0]

        if new_x < 0:
            new_x = self.width - 1
        if new_y < 0:
            new_y = self.height - 1
        if new_x >= self.width:
            new_x = 0
        if new_y >= self.height:
            new_y = 0

Toto je stránka lekce z kurzu, který probíhá nebo proběhl naživo s instruktorem.