for exampleif boardwidth and boardheight are both this function returns [[ ][ ][ none] counter board [ for in range(boardwidth) column [ for in range(boardheight) column append(counter counter +boardwidth board append(column counter -boardwidth (boardheight boardwidth board[boardwidth- ][boardheight- none return board def getblankposition(board) return the and of board coordinates of the blank space for in range(boardwidth)) for in range(boardheight) if board[ ][ =none return (xy def makemove(boardmove) this function does not check if the move is valid blankxblanky getblankposition(board if move =up board[blankx][blanky]board[blankx][blanky board[blankx][blanky ]board[blankx][blanky elif move =down board[blankx][blanky]board[blankx][blanky board[blankx][blanky ]board[blankx][blanky elif move =left board[blankx][blanky]board[blankx ][blankyboard[blankx ][blanky]board[blankx][blanky elif move =right board[blankx][blanky]board[blankx ][blankyboard[blankx ][blanky]board[blankx][blanky def isvalidmove(boardmove) blankxblanky getblankposition(board return (move =up and blanky !len(board[ ] or (move =down and blanky ! or