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 08:40
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year.txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
question
Computers and Technology, 22.06.2019 14:40
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 23.06.2019 07:00
1. you have a small business that is divided into 3 departments: accounting, sales, and administration. these departments have the following number of devices (computers, printers, etc.): accounting-31, sales-28, and administration-13. using a class c private network, subnet the network so that each department will have their own subnet. you must show/explain how you arrived at your conclusion and also show the following: all available device addresses for each department, the broadcast address for each department, and the network address for each department. also, determine how many "wasted" (not usable) addresses resulted from your subnetting (enumerate them).
Answers: 3
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
Mathematics, 15.11.2019 22:31
question
History, 15.11.2019 22:31
question
Chemistry, 15.11.2019 22:31
Questions on the website: 13722360