合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

        CAN201代做、python語(yǔ)言程序代寫(xiě)
        CAN201代做、python語(yǔ)言程序代寫(xiě)

        時(shí)間:2024-10-27  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



        CAN201 In Class Test 1 Thursday Session 2
        Multiplayer Number Guessing Game (UDP Sockets)
        Objective
        This in class test is required to use Python for socket programming. You will create a multiplayer “number guessing” game using UDP sockets programming, with one server and multiple clients (two clients for testing).
        Task Description
        You need to implement two simple programs: a server and a client. The server manages the game logic, while the clients communicate with the server to participate in the game.
        Game Rules:
        Server Behavior
        1. Initialization: The server listens/waits on a specified IP and port.
        2. Client Connection:
        o When a client connects, the server asks for the client’s name.
        o After receiving the name, the client is marked as "ready". 3. Game Start:
        o The game starts when all connected clients are "ready".1
        o The server generates a random number (e.g., **100). 4. Gameplay:
        o The server prompts each client in turn to guess the number. o The server checks the guess:
        § Ifcorrect,theserverannouncesthewinnertoallclientsandendsthegame.
        § If incorrect, the server informs all clients whether the guess is too high or
        too low, and then prompts the next client.
        o Next turn order: the player who guesses closest gets to guess first in the next turn. 5. Game End: The game ends when a client guesses correctly. (To make it simpler, no restart
        is required. That means we only test once.)
        Client Behavior
        1. Connect to Server: Clients connect to the server using its IP and port of the server.
        2. Submit Name: Clients send their name when prompted by the server.
        3. Gameplay:
        o Clients wait for their turn to guess.
        o When prompted, the client sends a guess to the server.
        o The client receives feedback from the server about their guess.
        6. Game End: Clients are notified when the game ends. (To make it simpler, no restart is required. That means we only test once.)
        1 When we test your code, we will start two clients (two clients code should let the server know their joining) first, and then enter client’s name one by one.
            
        Implementation Requirements
        • Language: Python 3.x
        • Sockets: Use socket module, UDP protocol.
        • Error Handling: Implement basic error handling for invalid inputs.
        Program Execution
        1. Server Execution (in terminal):
        python server.py --ip <server_ip> --port <port> Example:
        python server.py --ip 192.168.0.100 --port 42345
        2. Client Execution (in terminal):
        python client.py --ip <server_ip> --port <port> Example:
        python client.py --ip 192.168.0.100 --port 42345
        Submission
        Package server.py and client.py into a zip file and submit it to Learningmall’s submission link.
        Sample Interaction
        Server Output
        Server started on 192.168.0.100:42345 Client connected: (192.168.0.101, 54**1) Client connected: (192.168.0.102, 54**2) Received name: Alice
        Received name: Bob
        All clients are ready. Starting the game. Random number generated: 42
        Prompting Alice to guess.
        Received guess 30 from Alice. Too low. Prompting Bob to guess.
        Received guess 50 from Bob. Too high. Prompting Bob to guess.
        Received guess 42 from Bob. Bob wins! Client Output (Alice)
        Connected to server at 192.168.0.100:42345 Enter your name: Alice
        Waiting for other players...
        Game started!
        Your turn to guess.
        Enter your guess: 30
        Your guess is too low.
        Waiting for your turn...
        Bob guessed 50. The guess is too high.
               
        Waiting for your turn...
        Bob guessed 42 and won the game!
        Client Output (Bob)
        Connected to server at 192.168.0.100:42345 Enter your name: Bob
        Waiting for other players...
        Game started!
        Waiting for your turn...
        Alice guessed 30. The guess is too low. Your turn to guess.
        Enter your guess: 50
        Your guess is too high.
        Your turn to guess.
        Enter your guess: 42
        Congratulations! You guessed the number!
        Grading Criteria (Total: 5 points)
        1. Functionality (2 points)
        o 2 points: Correct implementation of game logic, including generating a random number,
        prompting clients to guess in turn, evaluating the guess (higher/lower), and broadcasting
        results to all clients.
        o 1 point: Basic communication between the client and server is established, including
        client connection and name registration.
        o 0 point: No submission or incorrect submission.
        2. Code Quality and Standards (1 point)
        o 1 point: Code is well-structured, with appropriate comments, clear variable naming,
        and logical organization.
        o 0.5 points: The submitted program has no major syntax errors and can run correctly. o 0 point: No submission or incorrect submission.
        3. Timely Submission (2 point)
        o 2 points: Complete submission of server.py and client.py files during the lab. o 1 point: Complete submission of server.py and client.py files within 24 hours. o 0 points: Incomplete or late submission or missing any file.


            
        請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp






         

        掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
      1. 上一篇:代做CENG 2310、代寫(xiě)matlab設(shè)計(jì)編程
      2. 下一篇:AM05 AUT24代做、代寫(xiě)R設(shè)計(jì)編程
      3. 無(wú)相關(guān)信息
        合肥生活資訊

        合肥圖文信息
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
        戴納斯帝壁掛爐全國(guó)售后服務(wù)電話24小時(shí)官網(wǎng)400(全國(guó)服務(wù)熱線)
        戴納斯帝壁掛爐全國(guó)售后服務(wù)電話24小時(shí)官網(wǎng)
        菲斯曼壁掛爐全國(guó)統(tǒng)一400售后維修服務(wù)電話24小時(shí)服務(wù)熱線
        菲斯曼壁掛爐全國(guó)統(tǒng)一400售后維修服務(wù)電話2
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國(guó)24小時(shí)客服熱線
        美的熱水器售后服務(wù)技術(shù)咨詢電話全國(guó)24小時(shí)
        海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士4號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士3號(hào)線
        合肥機(jī)場(chǎng)巴士2號(hào)線
        合肥機(jī)場(chǎng)巴士2號(hào)線
      4. 幣安app官網(wǎng)下載 短信驗(yàn)證碼 丁香花影院

        關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

        Copyright © 2024 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
        ICP備06013414號(hào)-3 公安備 42010502001045

        主站蜘蛛池模板: 日韩十八禁一区二区久久| 一区二区三区在线播放视频| 精品国产亚洲第一区二区三区| 自拍日韩亚洲一区在线| 国产一区二区三区无码免费| 中文字幕日韩一区| 国产成人一区二区三区在线| 久热国产精品视频一区二区三区 | 亚洲一区无码中文字幕乱码| 国产精品被窝福利一区| 波多野结衣一区二区三区高清在线 | 激情内射亚洲一区二区三区| 亚洲熟女少妇一区二区| 国产伦精品一区二区三区视频金莲 | 亚洲AV成人精品一区二区三区| 精品性影院一区二区三区内射| 日本一区二区三区在线观看| 久久婷婷色综合一区二区| 精品不卡一区中文字幕| 精品中文字幕一区在线| 高清一区二区三区| 国产AV国片精品一区二区| 亚洲av高清在线观看一区二区| 三级韩国一区久久二区综合| 精品中文字幕一区二区三区四区| 天堂不卡一区二区视频在线观看| 福利国产微拍广场一区视频在线| 国内精品视频一区二区三区| 国产精品日韩一区二区三区| 国产福利在线观看一区二区| 天堂不卡一区二区视频在线观看| 日本精品一区二区三区四区| 一区二区三区四区精品| 亚洲一区爱区精品无码| 无码精品人妻一区二区三区免费看| 日韩一区精品视频一区二区| 亚洲综合在线一区二区三区| 国产一区在线电影| 日韩精品无码一区二区三区AV| 又硬又粗又大一区二区三区视频| 亚洲AV福利天堂一区二区三|