if fliptally = input('you lose turn press enter to continue 'turn opponent swap turns to the other player continue ask the player for their movevalidmoves getvalidmoves(gameboardturnfliptallyif validmoves =[]print('there are no possible movesso you lose turn 'input('press enter to continue 'turn opponent swap turns to the other player continue while trueprint('select move'fliptally'spaces'end=''print(join(validmovesquit'move input(''lower(if move ='quit'print('thanks for playing!'sys exit(if move in validmovesbreak exit the loop when valid move is selected print('that is not valid move 'perform the selected move on the boardif move ='home'subtract tokens at home if moving from homegameboard[home- nexttrackspaceindex fliptally elsegameboard[moveempty set the "fromspace to empty nexttrackspaceindex track index(movefliptally movingontogoal nexttrackspaceindex =len(track if movingontogoalgameboard[goal+ check if the player has wonif gameboard[goal= displayboard(gameboardprint(turn'has won the game!'print('thanks for playing!'sys exit(elsenextboardspace track[nexttrackspaceindexcheck if the opponent has tile thereif gameboard[nextboardspace=opponentgameboard[opponenthome+ set the "tospace to the player' tokengameboard[nextboardspaceturn check if the player landed on flower space and can go againroyal game of ur