I was reading a code of 2048 game and came across the following snippet
def up(game):
print("up")
# return matrix after shifting up
game=transpose(game)
game,done=cover_up(game)
temp=merge(game)
game=temp[0]
done=done or temp[1]
game=cover_up(game)[0]
game=transpose(game)
return (game,done)
according to my understanding, game is a matrix that is passed to a function that executes multiple function to preform up logic on the game. I am not able to understand the line
game,done=cover_up(game)
done is a boolean variable.
My other doubt is
done=done or temp[1]
Temp is a temporary variable for the matrix. boolean = True/false OR Matrix this doesn't make sense to me. Please help me with the following syntax I am new to python. Thank you