I have the following python code:
if direction == 0: # Left
moved = self.slideLeft()
elif direction == 1: # Right
moved = self.slideRigth()
elif direction == 2: # Up
moved = self.slideUp()
elif direction == 3: # Down
moved = self.slideDown()
if(moved):
I know there is no swith statement in python but i am curious if there maybe is a nicer way to write this. Btw moved is just a Boolean