-
-
Save tebeka/569142edea1fd08bdd9ea944ba7c840e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enum import IntEnum | |
class Bounds(IntEnum): | |
MAX_X = 100 | |
MAX_Y = 100 | |
def advance(point: tuple): | |
"""Advance point on step up to (MAX_X, MAX_Y)""" | |
match point: | |
case (Bounds.MAX_X, Bounds.MAX_Y): | |
return (Bounds.MAX_X, Bounds.MAX_Y) | |
case (x, Bounds.MAX_Y): | |
return (x + 1, Bounds.MAX_Y) | |
case (Bounds.MAX_X, y): | |
return (Bounds.MAX_X, y+1) | |
case (x, y): | |
return (x+1, y+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment