99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

CSCI 201代做、代寫c/c++,Python編程
CSCI 201代做、代寫c/c++,Python編程

時間:2024-11-01  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Assignment #2
CSCI 201 Fall 2024
Page 1 of 11
Assignment #2
CSCI 201 Fall 2024
6% of course grade
Title
Networked Crossword Puzzle
Topics Covered
Networking 
Multi-Threading
Concurrency Issues
Introduction
This assignment will require you to create two different programs – a server and a client. You 
will implement a networked crossword puzzle game where multiple users can play against each 
other. There will be some concurrency issues since you will need to make sure only certain 
clients can play at different times. There will be many ways to design out the program, so I 
recommend you spend some time designing it out on paper before you begin coding.
Crossword puzzle game
A crossword puzzle is a word game consisting of interlocking horizontal and vertical grids. 
Participants enter letters into these grids based on the provided clues. The game concludes when 
all empty grids are correctly filled. Typically, the horizontal grids are referred to as ACROSS 
entries, while the vertical grids are called DOWN entries. Each across or down entry, which 
consists of a series of grids, corresponds to a word or phrase. All entries are indexed, and the 
corresponding clues are provided for the participants. Additionally, the intersection of an across 
entry and a down entry indicates a shared letter at that specific location, which usually serves as 
an extra hint besides the entry-specific clues.
Crossword puzzle game example
Assignment #2
CSCI 201 Fall 2024
Page 2 of 11
Server Functionality
The server will be responsible for reading the puzzle data from a file and distributing it to the 
clients when they connect. To simplify execution of your program, only one game can be 
occurring at a time. Each game will have between 1 and 3 players. The first client to connect to 
the server will specify the number of players.
The server will have (possibly) multiple puzzle data files in a directory called gamedata at the 
top of your project directory. Make sure that you specify a relative path when reading the puzzle
data files so the graders can drop their puzzle data files in the gamedata directory and run your
program without having to change any hard-coded variables. Your server program will need to
open the directory that contains all the puzzle data files and determine how many files are in that 
directory. It will then randomly choose one of the files to use. Of course, if there is only one file 
in the directory, that is the one that will be chosen. The names of the files are irrelevant since the 
server will choose one of them randomly, so they could be named anything at all.
Each game data file will contain all the information needed to play a game. The file will be 
formatted as a Comma Separated Value (CSV) file with ACROSS on the first line, followed by one
or more lines formatted as:
ACROSS,,
<number>,<answer>,<question>
The file will then have a line with the word DOWN, then one or more lines formatted the same as 
above. Here is a sample file:
ACROSS,,
1,trojans,What is USC’s mascot?
2,dodgers,What professional baseball team is closest to USC? 
3,csci,What is the four-letter prefix for Computer Science? 
DOWN,,
1,traveler,What is the name of USC’s white horse? 
4,gold,What is one of USC’s colors?
5,marshall,Who is USC’s School of Business named after?
Your server program will need to determine if the file is formatted properly. The only rules that 
you need to check are the following:
1. The words ACROSS and DOWN exist on their own lines and only one time in the file and
are followed by empty CSV fields. 
2. The other lines in the file are formatted with three parameters – integer, answer, question.
a. The three parameters are separated by commas as it is normal for CSV files.
Assignment #2
CSCI 201 Fall 2024
Page 3 of 11
3. If a number in the ACROSS section matches a number in the DOWN section, the 
answers must start with the same letter. In the example above, the lines with 
trojans and traveler both start with same letter “t”, since their number is 
the same, “1”.
4. An answer cannot contain any whitespace.
5. Questions normally will contain whitespace.
The server will need to determine how to format the answers in the game board so it can send out 
that information to all the clients (since the clients all need to render the game board the same).
There will be different ways that the data can be rendered. You can assume that there is at least 
one viable way to render the game board. In other words, you can assume that each word 
contains at least one letter that is in another word and the board can be rendered for the player. 
This may be challenging to figure out, so make sure to write out an algorithm to solve this before 
you begin coding.
If the ACROSS number and the DOWN number are the same, that means the answers will start 
with the same letter, as explained above. The numbers do not have to be in order in the file, but 
all the questions for a section will immediately follow the lines with ACROSS or DOWN.
There will not be more than one ACROSS or DOWN section in a file.
All the answers to the questions are case-insensitive. The server will wait to randomly 
determine a game file to read until the first client has connected.
The server will listen on port 3456. When a client connects to it, it will randomly determine a 
game data file to read, verify that the file is formatted properly, and figure out a rendering of the
game board. If there are no valid game files, the server should report that to the client and
continue waiting for another client to connect. At that point, it will read the directory again and 
randomly choose another game data file.
When the first client connects to it, the first message it sends will be a number between 1 and 3 
to determine how many players will be part of the game. If the number is 1, the server can start 
the game. If the number is 2 or 3, the server will need to wait until the proper number of clients 
have connected to the server before starting the game.
Game Play
Once the proper number of players have joined the game, the server will send out the game board 
to all the players. The players will begin play in the order they joined the game. Only one player 
should be able to play at a time. More information on how the client will behave is included in 
the relevant section below. Every play should be sent to the server. The server validates
whether the answer provided for the appropriate question is correct. If it is, the same player who 
guessed the correct answer will get to play again. If it is incorrect, play will proceed to the next 
player. Regardless, the server should send a notification to all the clients letting them know what 
Assignment #2
CSCI 201 Fall 2024
Page 4 of 11
question the player was attempting to answer, what the player guessed, and whether it was 
correct.
The server should keep track of how many correct answers each player has guessed, and which 
questions are remaining. Once all the questions have been answered correctly, the server will 
notify all the players of the final score (1 point for each question answered correctly) and who 
the winner is (or a tie, if that is the case).
You do not need to maintain statistics, and there are no user accounts. Once a game concludes, 
the clients should terminate. The server should loop and allow a new game to begin by having 
another client connect. The server cannot allow another game to begin while a game is being 
played – only one game is played at a time. The server should never have to be restarted, 
though, to play subsequent games. Once the server has started, the only way to stop playing 
games is to “kill” the server, which is done by clicking “Terminate”, the red square, in Eclipse. 
Client Functionality
The client will begin by welcoming the user to the game and prompting them for the server 
hostname and port. If a valid connection is not made, an error message should be displayed, and 
the client should loop back to allow the user to enter another server hostname and port. If a valid 
connection is made, the first client should prompt for the number of players. The valid number
of players is between 1 and 3. The first client should continue prompting for the number of 
players until a valid number is entered.
If the necessary number of players have not yet joined the game, all the clients, except for the 
last one to join, should display a message that says “Waiting for player x.” The “x” 
should be replaced by the player number for which we are waiting. When a player joins, all 
clients, except for the last one, should display a message stating from which IP address the player
joined.
Once all the required players have joined, all clients should display a message that says, “The
game is beginning.” The server will send the game board, which includes the crossword 
puzzle and the questions.
Play will proceed through the players based on the order they joined the game. Player 1 will go 
first and select to guess the answer to a question that is either “down” or “across”, as in “Would
you like to answer a question across (a) or down (d)?”. If “d” or “a” is not 
entered, the client should prompt the user again. The user will then be prompted to enter a 
number for which question to answer, as in “Which number?”. If the value entered is not 
valid, the client should prompt the user again.
Once the user has entered a valid question, (let’s assume “a” and “1” were entered), the client 
should prompt the user to enter the answer to the question, “What is your guess for 1 
Assignment #2
CSCI 201 Fall 2024
Page 5 of 11
across?” The answer should be sent to the server, which will return whether it was correct or 
incorrect to all the connected clients. The (possibly) updated game board and remaining
questions to answer will be sent to all clients. Do not display questions that have already been 
answered correctly.
If a player answers a question correctly, they will get to answer another question. If the answer 
was incorrect, play will move to the next client who joined. If the last player that joined answers 
a question incorrectly, play will proceed with the first player.
Play continues until all the correct answers have been guessed. The completed game board with
all the questions will be displayed, and the final scores will be shown. The final score is only 
based on how many questions a user guessed correctly. If one player has more correct answers 
than any the others, that player is declared the winner. If two players have the same score, the 
game is declared as a tie.
All the clients will then terminate, but the server will loop back to allow new players to join and 
start a new game.
The sample execution that follows shows all the messages that should be displayed throughout 
the game. Your output should be as close as possible to the one shown below, though the
crossword puzzle may look different for the same answers since that will be based on how your 
program generates it.
Assignment #2
CSCI 201 Fall 2024
Page 6 of 11
Sample Execution
Below is a sample execution of the program with the user input in bold red (though the input
will not be bolded, or colored, when you run your program). The first column is the server, the 
second column is the first player, and the third column is the second player. Ignore all the extra 
blank lines that are displayed, to try to show you the timeline at which output is generated, but in 
the actual output, all the lines will be displayed next to each other. This sample run is using the 
sample puzzle game file that was provided earlier in the assignment.
Server Player 1 Player 2
Listening on port 3456.
Waiting for players...
Welcome to 201 Crossword!
Enter the server hostname: localhost
Enter the server port: 3456
Connection from 127.0.0.1
How many players will there be? 2
Number of players: 2 
Waiting for player 2. 
Reading random game file.
File read successfully.
Waiting for player 2.
Welcome to 201 Crossword!
Enter the server hostname:
localhost
Enter the server port: 3456
Connection from 127.0.0.1
Player 2 has joined from 127.0.0.1. There is a game waiting for you.
Player 1 has already joined.
Game can now begin.
The game is beginning. The game is beginning.
Sending game board. 5_
Across
1 What is USC’s mascot?
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business
named after?
Across
1 What is USC’s mascot?
2 What professional baseball team
is closest to USC?
3 What is the four-letter prefix
for Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business
named after?
Assignment #2
CSCI 201 Fall 2024
Page 7 of 11
Player 1’s turn.
Would you like to answer a question 
across (a) or down (d)? d
That is not a valid option?
Would you like to answer a question 
across (a) or down (d)? a
Which number? 4
That is not a valid option. 
Which number? 1
What is your guess for 1 across?
trojans
Player 1’s turn.
Player 1 guessed “trojans” for 
1 across.
Player 1 guessed “trojans” for 1 
across.
That is correct.
That is correct. That is correct.
Sending game board.
Across
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Across
2 What professional baseball team
is closest to USC?
3 What is the four-letter prefix
for Computer Science?
Down
1 What is the name of USC’s
white horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Player 1’s turn.
Would you like to answer a question 
across (a) or down (d)? d
Which number? 1
What is your guess for 1 down? Trav
Player 1 guessed “Trav” for 1 
down.
Player 1 guessed “Trav” for 1 
down.
That is incorrect.
That is incorrect. That is incorrect.
Sending game board.
Assignment #2
CSCI 201 Fall 2024
Across
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Across
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Players 2’s turn.
Players 2’s turn. Would you like to answer a question 
across (a) or down (d)? d
Which number? 1
What is your guess for 1 down?
traveler
Player 2 guessed “traveler” 
for 1 down.
Player 2 guessed “traveler” for 1 
down.
That is correct.
That is correct. That is correct.
Sending game board.
Across
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Across
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Assignment #2
CSCI 201 Fall 2024
Page 9 of 11
Player 2’s turn.
Player 2’s turn. Would you like to answer a question 
across (a) or down (d)?
<Play continues until all questions have been answered correctly.>
<Assume everything has been answered correctly except 2 across, and it’s player 1’s turn.>
Sending game board.
2 What professional baseball team is
closest to USC?
Across
2 What professional baseball team is
closest to USC?
Player 1’s turn.
Would you like to answer a question 
across (a) or down (d)? d
That is not a valid option.
Would you like to answer a question 
across (a) or down (d)? a
Which number? 2
What is your guess for 2 across?
Dodgers
Player 1’s turn.
Player 1 guessed “Dodgers”
for 2 across.
Player 1 guessed “Dodgers” for 2
across.
That is correct.
That is correct. That is correct.
Sending game board.
Across
1 What is USC’s mascot?
Across
1 What is USC’s mascot?
Assignment #2
CSCI 201 Fall 2024
Page 10 of 11
The game has concluded. 
Sending scores.
Waiting for players...
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Final Score
Player 1 – 4 correct answers.
Player 2 – 2 correct answers. 
Player 1 is the winner.
<Client terminates>
2 What professional baseball team is 
closest to USC?
3 What is the four-letter prefix for 
Computer Science?
Down
1 What is the name of USC’s white 
horse?
4 What is one of USC’s colors?
5 Who is USC’s School of Business 
named after?
Final Score
Player 1 – 4 correct answers.
Player 2 – 2 correct answers. 
Player 1 is the winner.
<Client terminates>
Assignment #2
CSCI 201 Fall 2024
Page 11 of 11
Grading Criteria
The way you go about implementing the solution is not specifically graded, but the output must 
match exactly what you see in the execution above. The maximum number of points earned is 
5.
Networking (0.5)
0.1 - first client can connect to server
0.2 - only the number of clients as specified by first client can connect to server
0.2 - server allows a new game to be played after previous one ends without restarting
File Reading (0.5)
0.1 - random file chosen from gamedata directory 
0.1 - gamedata directory is at the top of the project folder
0.1 - server chooses game data file after first client connects 
0.2 - client is notified if no valid game data file exists
Game Board Rendering (1.5)
1.5 - game board is rendered in a correct manner where there are no disjoint words (i.e., they are all 
connected to each other)
Game Play (1.5)
0.1 - only one player can answer a question at a time
0.1 - once a question has been answered correctly, that question is no longer displayed 
0.1 - answers are case-insensitive
0.1 - proper error checking is in place for “a” and “d”
0.1 - proper error checking is in place for the question number to answer 
0.2 - all clients are notified of answers that are guessed by other players 
0.1 - updated game board is displayed properly
0.3 - final score is displayed after all answers have been guessed correctly 
0.1 - client terminates after the final score is displayed
0.3 - the game is played as expected with no exceptions, crashing, deadlock, starvation, or freezing
Output (0.4)
0.4 - the output is the same as what is provided in the sample above
Synchronization (0.6)
0.3 - synchronization through monitors, locks, or semaphores is used somewhere in the server 
0.3 - synchronization through monitors, locks, or semaphores is used somewhere in the client

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp







 

掃一掃在手機打開當前頁
  • 上一篇:代寫CIS5200、代做Java/Python程序語言
  • 下一篇:代寫SI 100B、代做Python設計程序
  • ·代寫G6077程序、代做Python編程設計
  • ·代做COMP SCI 7412、代寫Java,python編程
  • ·代做COMP642、代寫Python編程設計
  • ·代寫CSSE7030、代做Python編程設計
  • ·&#160;COMP338代做、python編程語言代寫
  • ·代做3DA3 C02、Java/python編程代寫
  • ·代做cmsc14100 編程、代寫python編程語言
  • ·代做ENG5027、代寫Python編程設計
  • ·FINM8006代寫、代做Python編程設計
  • ·ITMF7.120代寫、代做Python編程設計
  • 合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                韩日欧美一区二区三区| 色综合天天综合网天天狠天天| 国产一区二区不卡| 精品国产91九色蝌蚪| 国产精品自在在线| 亚洲色图一区二区三区| 欧美人xxxx| 黄色成人免费在线| 国产亚洲成aⅴ人片在线观看| 国产宾馆实践打屁股91| 亚洲欧美综合色| 欧美日韩国产三级| 国产精品一区二区在线播放| 国产精品久久久久7777按摩| 欧美日韩在线三级| 国内成人免费视频| 亚洲欧美韩国综合色| 91精品国产高清一区二区三区 | 欧美精品亚洲二区| 福利电影一区二区| 日韩电影在线免费| 日韩一区欧美小说| 欧美成人精品3d动漫h| 91麻豆123| 国产精品99久久不卡二区| 亚洲国产一区二区视频| 日本一区二区三区dvd视频在线| 在线视频欧美精品| 成人激情视频网站| 国模大尺度一区二区三区| 亚洲午夜国产一区99re久久| 欧美国产日韩精品免费观看| 日韩午夜电影av| 欧美亚洲国产怡红院影院| 高清免费成人av| 国模娜娜一区二区三区| 免费黄网站欧美| 亚洲一区视频在线| 国产精品视频免费看| 久久伊人蜜桃av一区二区| 91精品国产欧美一区二区成人 | 盗摄精品av一区二区三区| 日韩电影在线观看一区| 夜夜嗨av一区二区三区中文字幕| 国产欧美精品日韩区二区麻豆天美| 日韩欧美电影在线| 欧美一区二区三区免费在线看| 欧美无砖专区一中文字| 欧美天堂亚洲电影院在线播放| 91麻豆自制传媒国产之光| 成人av资源站| 99久久99久久久精品齐齐| 99在线热播精品免费| 99久久精品费精品国产一区二区| 成人国产亚洲欧美成人综合网 | 中文字幕日韩精品一区| 中文字幕国产一区| 中文字幕在线一区| 亚洲人快播电影网| 一区av在线播放| 五月天一区二区三区| 日本中文一区二区三区| 久久国产精品色| 国产成人鲁色资源国产91色综| 成人久久视频在线观看| 日本黄色一区二区| 欧美电影一区二区| 久久久久久99精品| 最新不卡av在线| 亚洲h在线观看| 久久99蜜桃精品| 成人毛片在线观看| 欧美色区777第一页| 欧美一区二区三区在线| 久久综合久久鬼色| 日韩毛片视频在线看| 午夜视频久久久久久| 国模冰冰炮一区二区| 99久久国产综合精品女不卡| 欧美精品三级日韩久久| 久久久综合网站| 1000精品久久久久久久久| 天堂午夜影视日韩欧美一区二区| 久久国产尿小便嘘嘘尿| 99久久精品免费| 日韩精品一区二区三区四区| 亚洲四区在线观看| 国内外成人在线| 精品久久一区二区| 国产精品视频九色porn| 日韩中文欧美在线| 91啪亚洲精品| wwwwxxxxx欧美| 亚洲精品成人在线| 国产高清久久久久| 欧美精品1区2区3区| 中文字幕日本不卡| 国产一区二区三区免费| 欧美日韩精品专区| 亚洲精品精品亚洲| 国产精品亚洲成人| 欧美大片在线观看一区| 亚洲高清视频中文字幕| av激情成人网| 国产女人18毛片水真多成人如厕| 丝袜诱惑亚洲看片 | 成人sese在线| 久久久久久久久一| 久久国产精品露脸对白| 9191成人精品久久| 丝袜国产日韩另类美女| 色8久久人人97超碰香蕉987| 中文子幕无线码一区tr| 国产精品一级黄| 精品福利av导航| 久久国产视频网| 日韩精品中文字幕一区二区三区 | 一区二区三区欧美在线观看| 国产精品一级二级三级| 欧美电影免费观看高清完整版在线观看 | 国产精品888| 精品国产91乱码一区二区三区 | 国产精品中文字幕一区二区三区| 日韩一区二区在线播放| 日本不卡视频在线| 91.成人天堂一区| 蓝色福利精品导航| 久久午夜电影网| 成熟亚洲日本毛茸茸凸凹| 中文字幕精品一区二区三区精品| 丁香婷婷深情五月亚洲| 国产精品视频一二三区| 99久久99久久精品国产片果冻| 国产精品麻豆一区二区| 99久久99精品久久久久久| 亚洲欧美偷拍卡通变态| 欧美日韩高清一区二区| 久久国产剧场电影| 亚洲国产精品成人综合| 一本一道久久a久久精品| 亚洲一区二区三区美女| 欧美成人video| 成人午夜短视频| 一区二区激情视频| 日韩免费视频一区二区| 成人午夜在线播放| 亚洲国产成人av| 精品动漫一区二区三区在线观看| 精品一区二区三区久久久| 国产精品久久福利| 欧美精品在线观看一区二区| 精东粉嫩av免费一区二区三区| 国产性色一区二区| 91福利小视频| 久久爱www久久做| 亚洲免费在线视频| 久久综合九色综合久久久精品综合| 国产999精品久久| 日韩二区三区在线观看| 国产精品久久久久9999吃药| 666欧美在线视频| gogogo免费视频观看亚洲一| 蜜臀精品久久久久久蜜臀| 欧美韩日一区二区三区四区| 777xxx欧美| 91香蕉国产在线观看软件| 精品系列免费在线观看| 亚洲第一福利一区| 亚洲欧美一区二区三区孕妇| 精品国产123| 欧美一区二区三区小说| 色综合色综合色综合| 国产精品原创巨作av| 蜜臀av性久久久久av蜜臀妖精| 亚洲精品午夜久久久| 欧美国产欧美综合| 精品久久久久久久久久久久久久久| 色综合一个色综合亚洲| 波多野结衣中文一区| 激情五月婷婷综合| 美腿丝袜亚洲一区| 天堂久久久久va久久久久| 一区二区三区不卡在线观看 | 夜色激情一区二区| 国产精品激情偷乱一区二区∴| 在线播放91灌醉迷j高跟美女 | 一区二区欧美国产| 成人欧美一区二区三区小说| 精品久久人人做人人爰| 欧美一区二区三区在线观看| 欧美喷水一区二区| 欧美亚洲一区二区三区四区| 91美女蜜桃在线| 91网站在线播放| 色综合久久综合网| 在线看国产日韩| 欧美影院一区二区| 欧美精品在线观看播放| 91精品国产综合久久久久久久| 欧美一区二视频|