def getcornerworstmove(boardtile) return cornera spaceor the move that flips the least number of tiles possiblemoves getvalidmoves(boardtile randomize the order of the possible moves random shuffle(possiblemoves always go for corner if available for xy in possiblemoves if isoncorner(xy) return [xy return getworstmove(boardtile print('welcome to reversi!'how the aisim py code works lot of these functions are similar to one anotherand some of them use the new isonside(function here' review of the new algorithms we've madefunction getrandommove(table - functions used for our reversi ai description randomly choose valid move to make getcornersidebestmove(take corner move if available if there' no cornertake space on the side if no sides are availableuse the regular getcomputermove(algorithm getsidebestmove(take side space if there' one available if notthen use the regular getcomputermove(algorithm this means side spaces are chosen before corner spaces getworstmove(take the space that will result in the fewest tiles being flipped getcornerworstmove(take corner spaceif available if notuse the getworstmove(algorithm post questions to