reate 3 new modules with the following details:

Introduction to the Lab :For this lab, I would like you to use sockets to pass the player moves between the client and server. Assuming our tic tac toe game uses a 3 x 3 board, we will use x/X and o/O for the values that we will be passing back and forth. For those not familiar with Tic Tac Toe, it is a 2 player game where one player’s game piece is X and the second player’s game piece is O (letter). Each player takes a turn putting their game piece in one of the empty slots in the 3 by 3 board. First place to get 3 of their game pieces that align wins. If the board has no empty slots and nobody wins then the game ends in a tie.Please read the program details and important details below.Program Details:You will create 3 new modules with the following details:class BoardClass (gameboard.py)The board game will consist of the following public interface. (Note this module can be imported and used by both player1 and player2 modulesThe class should have a minimum of the following (you can add more if you need to):Attributes:Players user nameUser name of the last player to have a turnNumber of winsNumber of tiesNumber of lossesFunctions:updateGamesPlayed()Keeps track how many games have startedresetGameBoard()Clear all the moves from game boardupdateGameBoard()Updates the game board with the player’s moveisWinner()Checks if the latest move resulted in a winUpdates the wins and losses countboardIsFull()Checks if the board is full (I.e. no more moves to make – tie)Updates the ties countprintStats()Prints the following each on a new line:Prints the players user namePrints the user name of the last person to make a moveprints the number of gamesPrints the number of winsPrints the number of lossesPrints the number of tiesmodule Player1 (player1.py)Player 1 will ask the user for the host information of player 2:Prompt the user for the host name/IP address of player 2 they want to play withPrompt the user for the port to use in order to play with player 2Using that information they will attempt to connect to player 2Upon successful connection they will send player 2 the their user name (over the socket, just alphanumeric user name with no special characters)If the connection cannot be made then the user will be asked if they want to try again:If the user enters ‘y’ then you will request the host information from the user againIf the user enters ‘n’ then you will end the programOnce player 1 receives player 2’s username or if the users decides to play again (see step 4.2 below)Player 1 will ask the user for their move using the built-in input() functionand send it to player 2.Player 1 will always be x/XPlayer 1 will always send the first move to player 2Each move will correspond to the input given using the keyboard.Once player 1 sends their move they will wait for player 2’s move.Repeat steps 3.1.2 – 3.1.4 until the game is over (A game is over when a winner is found or the board is full)Once a game as finished (win or tie) the user will indicate if they want to play again using the command line.If the user enters ‘y’ or ‘Y’ then player 1 will send “Play Again” to player 2If the user enters ‘n’ or ‘N’ then player 1 will send “Fun Times” to player 2 and end the programOnce the user is done player they will print all the statistics.module Player2 (player2.py)The user will be asked to provide the host information so that it can establish a socket connection.Player 2 will accept incoming requests to start a new gameWhen a connection request is received and accepted, player 2 will wait for player 1 to send their user nameOnce player 2 receives player 1’s user name, then player 2 will send “player2” as their user name to player 1 (over the socket) and wait for player 1 to send their move.Once player 2 receives player 1’s move they will ask the user for their move and send it to player 1 using the built-in input() function.Each move will correspond to the input given using the keyboard.Once player 2 sends their move they will wait for player 1’s move.Repeat steps 3.1 – 3.2 until the game is over (A game is over when a winner is found or the board is full)Once a game as finished (win or tie) player 2 will wait for player 1 to indicate if they want to play again using the command line.If player 1 wants to play again then player 2 will wait for player 1’s first move.If player 1 does not wants to play again then player 2 will print the statisticsImportant Details:The User Interface is simple the shell console, you will not create a Graphical User Interface for this lab.All user inputs are case insensitive.Hint: Maintain the current state of the board on both client and server side to determine if someone won, lost or the board is full.Do not use global variables or write everything in 1 giant code block. Organize your code to use functions with inputs and outputs instead.You must use docstrings, specify input and return types, and follow general good practices for the code that you write. This is similar to how you saw Lab 2’s starter code was written. See the documentation below for more information:https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings (Links to an external site.)https://google.github.io/styleguide/pyguide.html#316-naming (Links to an external site.)https://google.github.io/styleguide/pyguide.html#317-main (Links to an external site.)https://google.github.io/styleguide/pyguide.html#318-function-length (Links to an external site.)https://google.github.io/styleguide/pyguide.html#319-type-annotations (Links to an external site.)Useful Links:https://steelkiwi.com/blog/working-tcp-sockets/ (Links to an external site.) (Note this link has example code for python 2. In Python 3, when you send a message you must add .encode() after a string, and when you want to receive a message you must add .decode() after the string)