subject

Please complete the following steps to complete the network game lab: 1. Configure your RPi to use DHCP and get an address automatically. Use the ifconfig command to get the address that is given, The IPv4 address should be 192.168.1.x. Please note the value x each time to start up your hardware in the lab. Others will need your full IPv4 address for game play to contact your RPi. 2. Create your application in a file called t3.c, following the requirements in the General Section. Build the project with the udp. c to make sure you are able to proceed. NOTE: You can actually open up two copies of the application in two bash shells and play a game between the two application instances by using the 192.168.1.x address from step 1. 3. Add command line argument support to your application, following the requirements in the Command Line Section. You must determine whether you will be a server or client and what the remote address of your opponent's RPi is. 4. Add code to open a listener port so you can receive messages from other users, following the requirements in the Listener Port Startup Section. 5. Add code to close out the listener port at the end of the application, following the requirements in the Shutdown Section. 6. Depending on whether the application is started as a server or client (determined in step 3), invite your opponent to play (if you are a client) or accept an invite to play from your opponent to play (if you are a server), following the requirements in the Client Startup or Server Startup Sections. 7. Initialize the game following the requirements in the Game Play Initialization Section. 8. Code the game play part of the project, following the requirements in the Game Play Loop Section. Application Requirements - Game Play Initialization: The game board layout is defined by a letter-number pair as follows: Al A2 A3 B1 B2 B3 C1 C2 C3 At the beginning, the game board can be initialized with periods to make the game field visible using a function like this: void clearBoard (char board [3] [31) for (int r = 0; r < 3; r++) for (int c = 0; c < 3; C++) board[r] C] = '.'; By definition please note the following: - the user running the server application makes the first move. - the server will be 'x' and the client will be 'o'. Application Requirements - Game Play Loop: In a while loop, you will alternate between making a move and getting a move from your opponent until a winner or draw occurs. Here are the steps make a move: 1. The user will enter a 2 character letter-number pair string. 2. The move is recorded in the board by calling addMove(), a function that you write, that verifies: - string length must be 2 characters - the first character is A, B, or C - the second character is 1, 2, or 3 - must be legal (the position must not have already been played) - if not a legal move, go back to step 1 The function prototype for this function is: bool addMove (char board [3] [3), char movell, char xo) which returns true is successful and false otherwise. 3. A function, showBoard(), that you write is called to display the board: void showBoard (char board [3] [3]) 4. The letter-number pair string is sent to the other player using the provided sendData() function. 5. A call is made to a function, is Winner(), that you write is called to determine if the user (xo) where xo is 'X' or 'o': bool isWinner (char board [3] [3], char xo) 6. A check is made to see if the game is a draw (no winner and 9 moves). Obviously, a draw can be determined in less than 9 moves, but checking for 9 moves is a simpler implementation. Here are the steps to process a move from your opponent: 1. The user call the provided receiveData() function to the string. 2. The move is recorded in the board by calling add Move(), a function that you write, that verifies: - string length must be 2 characters - the first character is A, B, or C - the second character is 1, 2, or 3 - must be legal (the position must not have already been played) - if not a legal move, exit game The function prototype for this function is: bool addMove (char board [3] [31, char movedl, char xo) which returns true is successful and false otherwise. 3. A function you write is called to display the board: void showBoard (char board [3] [3]) 4. A call is made to a function, is Winner(), that you write is called to determine if the user (xo) where xo is 'X' or 'o': bool isWinner (char board [3] [3), char xo) 5. A check is made to see if the game is a draw (no winner and 9 moves).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Jackson is teaching the decimal number system. he wants his students to know how to expand numbers by powers of 10. which is the correct order in which digits are assigned values in the decimal number system?
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Choose the answers that best complete each sentence. on average,are more expensive than other kinds of postsecondary schools. the cost of room and board includes. to save money, some students attend auniversity in their home state.
Answers: 2
question
Computers and Technology, 25.06.2019 07:00
What statement would cause polarization
Answers: 1
question
Computers and Technology, 25.06.2019 08:00
When date is processed into a meaningful form, i becomes
Answers: 1
You know the right answer?
Please complete the following steps to complete the network game lab: 1. Configure your RPi to use D...
Questions
question
History, 09.12.2020 21:00
question
Chemistry, 09.12.2020 21:00
question
English, 09.12.2020 21:00
question
History, 09.12.2020 21:00
question
Computers and Technology, 09.12.2020 21:00
question
Advanced Placement (AP), 09.12.2020 21:00
question
History, 09.12.2020 21:00
question
Engineering, 09.12.2020 21:00
Questions on the website: 13722361