move = input() if game.avaliable_moves(): if move == 'a': game.move_piece(side='left') elif move == 'd': game.move_piece(side='right') elif move == 'w': game.move_piece(side='counter_clockwise') elif move == 's': game.move_piece(side='clockwise') else: game.block_piece() # Remove last piece from the area game.clear_area() # Place piece with its new position game.place_piece() # Print game board in the nice format game.draw_area() if game.state == 'gameover': print( '\n\tGame has finished!' '\n(lack of avaliable moves to perform / piece has tried to spawn at the position of the past one)' '\nHave a nice day!')