代寫C C++ Java Python 視頻講解客服在線客服在線

代做國外C C++ Java程序 Python QQ 2365427650 Email [email protected] 免費咨詢編程問題

« Write the program in MIPSMIPS Emulator »

Fifteen Twenty Game

you are required to develop a Multi-player Entertainment Game System
on internet, which has a game server with game players.
This Multi-player Game System is to design and play a simple
Fifteen/Twenty Game
(
十五/二十遊戲) on internet platform.
For a simple Fifteen/Twenty game, there should be 2 players. For each player, he/she should
use both hands to send his/her submission. For each hand, a “Rock - ”represents a “0”
and a “Paper - ”represents a “5”. That means each player can submit “0” (both hands
submit Rock), “5” (one hand submits Rock and one hand submits Paper) or “10” (both hands
submit Paper).
The two players should send their submissions and guess the total submissions of the 2
players (which can be 0, 5, 10, 15 or 20) at the same time. If a player guesses the total
correctly (and the other player guesses the wrong total), the player wins the round. If both
players guess the total correctly or no player guesses the total correctly, there is no winner for
the round.
The followings are a few scenarios for you to understand better the rules of this simple
Fifteen/Twenty game :-
Scenario 1 :
Player 1 : submit 2 Rocks and guess the total to be 0
Player 2 : submit 1 Rock and 1 Paper and guess the total to be 10
Winner of this round : No winner

AY 2018-19
Game Servers Design and
Implementation (ITP4708)
Assignment Page: 3
Scenario 2 :
Player 1 : submit 1 Rock and 1 Paper and guess the total to be 15
Player 2 : submit 2 Papers and guess the total to be 15
Winner of this round : No winner
Scenario 3 :
Player 1 : submit 1 Rock and 1 Paper and guess the total to be 5
Player 2 : submit 1 Rock and 1 Paper and guess the total to be 10
Winner of this Round : Player 2
Scenario 4 :
Player 1 : submit 2 Papers and guess the total to be 20
Player 2 : submit 2 Papers and guess the total to be 10
Winner of this Round : Player 1
2. Fifteen/Twenty Game System
Game Server
The Fifteen/Twenty Game System has a game server responsible for the overall
coordination and broadcasting messages to clients (players). The game server with a game
server port number allows players to join the game. When the game server starts up, the
number of rounds
also needs to be specified.
The following is a sample script for starting up the game server :-
java GameServer 1234 4
(main server program : GameServer.java, server port number : 1234, the number of
rounds :
4)
When there are 2 players connected to the game server to join the game, the players can
play the Fifteen/Twenty Game for the number of rounds as specified. For each round of the
game, there can be “no player wins”, “Player 1 wins” or “Player 2 wins”. If there is a
winner in a round, 1 mark should be added to the winner’s score and no mark should be
deducted from other player.

AY 2018-19
Game Servers Design and
Implementation (ITP4708)
Assignment Page: 4
The score of each player should be stored in a MYSQL database table and should be
manipulated by the server. Whenever a player connects to the server, the server should
check and see if the player record already exists in the database table or not. If yes, the
player’s score should be reset to zero before the game starts. If no, the player record with
score zero should be added to the database table.
For each round of the game, each player can submit a “Rock” and a “Paper”, 2 “Rocks” or
2 “Papers” together with the guess of the total to the server. Only one set of submission for
each player is allowed and
duplicate submissions are ignored by the server. The server
should not show the submission of a player to the other player until both players have
submitted.
There is no rule on which player should submit first and which player should submit next.
Players are allowed to submit at any time after the round has started. After both
submissions are received, the server immediately broadcasts a summary of submissions
from both players and shows the winner of this round. The mark of the winner for this
round is added to the database table accordingly.
When the last round of the game is completed, the overall score of each player is retrieved
from the database table and the summary of result for the whole game is broadcasted to
both players.
Game Client
The client of this Fifteen/Twenty Game System should have a User Interface for the player
to send submissions (a “Rock” and a “Paper”, 2 “Rocks” or 2 “Papers” together with the
guess of the total) to server and receiving messages from server.
To start up the game client, it should specify
the player’s name, the server host name/ip
address
and the server port number for connecting to the server and letting the server
knows the player’s name.
The exact user interface design is to be determined by you. However, your player user
interface should be user-friendly and
no duplicate submission is allowed in a round/no
more submission is allowed after game over
.
The following is a sample script for starting up the two game clients :-
java GameClient Albert 127.0.0.1 1234
java GameClient Edmund 127.0.0.1 1234
(main client program : GameClient.java, server IP address : 127.0.0.1,
server port number : 1234)

  • 相關文章:

發表評論:

◎歡迎參與討論,請在這里發表您的看法、交流您的觀點。

最新評論及回復

最近發表

Powered By Z-Blog 1.8 Walle Build 100427

Copyright 代寫C.

体彩25选5开奖结果