sys exit( if response in ( dreplace(''') return response def makemove(boardmove) """carry out the given move on the given board "" notethis function assumes that the move is valid bxby findblankspace(board if move =' ' board[bx][by]board[bx][by+ board[bx][by+ ]board[bx][by elif move =' ' board[bx][by]board[bx+ ][byboard[bx+ ][by]board[bx][by elif move =' ' board[bx][by]board[bx][by- board[bx][by- ]board[bx][by elif move =' ' board[bx][by]board[bx- ][byboard[bx- ][by]board[bx][by def makerandommove(board) """perform slide in random direction "" blankxblanky findblankspace(board validmoves [ if blanky ! validmoves append(' ' if blankx ! validmoves append(' ' if blanky ! validmoves append(' ' if blankx ! validmoves append(' ' makemove(boardrandom choice(validmoves) def getnewpuzzle(moves= ) """get new puzzle by making random slides from solved state "" board getnewboard( for in range(moves) makerandommove(board return board if this program was run (instead of imported)run the game if __name__ ='__main__' main(after entering the source code and running it few timestry making experimental changes to it on your ownyou can also try to figure out how to do the followingcreate more difficult variant of the sliding tile puzzle sliding tile puzzle