The goals for this project are to demonstrate, experience, and explore all aspects of Java Internet Programming.

Similar documents
Activity 6: Playing Elevens

CS Project 1 Fall 2017

CS Programming Project 1

BRIDGE is a card game for four players, who sit down at a

More Probability: Poker Hands and some issues in Counting

User Guide / Rules (v1.6)

Texas Hold em Poker Basic Rules & Strategy

Introductory Module Object Oriented Programming. Assignment Dr M. Spann

Presents: Basic Card Play in Bridge

Supreme Hot Video Slot. Introduction. How to Bet. Gamble Feature

Poker: Further Issues in Probability. Poker I 1/29

Welcome to the Best of Poker Help File.

Sheepshead, THE Game Set Up

To play the game player has to place a bet on the ANTE bet (initial bet). Optionally player can also place a BONUS bet.

Poker Hands. Christopher Hayes

Spade 3 Game Design. Ankur Patankar MS Computer Science Georgia Tech College of Computing Cell: (404)

Corners! How To Play - a Comprehensive Guide. Written by Peter V. Costescu RPClasses.com

Eleventh Annual Ohio Wesleyan University Programming Contest April 1, 2017 Rules: 1. There are six questions to be completed in four hours. 2.

Live Casino game rules. 1. Live Baccarat. 2. Live Blackjack. 3. Casino Hold'em. 4. Generic Rulette. 5. Three card Poker

After receiving his initial two cards, the player has four standard options: he can "Hit," "Stand," "Double Down," or "Split a pair.

Distributed Slap Jack

{ a, b }, { a, c }, { b, c }

7 Diamonds. Link to Online Interface: CS DESIGN GAMES (Under the guidance of Dr.

Electronic Wireless Texas Hold em. Owner s Manual and Game Instructions #64260

Level 2 Creating an event driven computer program using Java ( )

Sheepshead, THE Game Release Notes

Tứ Sắc Four Colors. General, herein marked with the letter A for easy identification to those not yet familiar with the Chinese characters,

Pianola User Guide for Players How to analyse your results, replay hands and find partners with Pianola

Counting Poker Hands

Problem Set 4: Video Poker

Apocalypse Defense. Project 3. Blair Gemmer. CSCI 576 Human-Computer Interaction, Spring 2012

Chapter 2 Integers. Math 20 Activity Packet Page 1

CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 8

Setup and Walk Through Guide Orion for Clubs Orion at Home

Instruction manual Chess Tutor

P a g e 1 HOW I LEARNED POKER HAND RANKINGS

MyBridgeBPG User Manual. This user manual is also a Tutorial. Print it, if you can, so you can run the app alongside the Tutorial.

I will walk you through step by step on how to set it up so that you can connect to the Team Speak server.

Scratch for Beginners Workbook

Pianola User Guide for Players How to analyse your results, replay hands and find partners with Pianola

LEARN HOW TO PLAY MINI-BRIDGE

Up & Down GOAL OF THE GAME UP&DOWN CARD A GAME BY JENS MERKL & JEAN-CLAUDE PELLIN ART BY CAMILLE CHAUSSY

OALCF Task Cover Sheet. Apprenticeship Secondary School Post Secondary Independence

Defensive Signals. Attitude Signals

with MultiMedia CD Randy H. Shih Jack Zecher SDC PUBLICATIONS Schroff Development Corporation

Poker Rules Friday Night Poker Club

LAWS Eitan Levy

LESSON 4. Eliminating Losers Ruffing and Discarding. General Concepts. General Introduction. Group Activities. Sample Deals

Programming Assignment 4

The Secret to Performing the Jesse James Card Trick

GAMBLING ( ) Name: Partners: everyone else in the class

CS61B, Fall 2014 Project #2: Jumping Cubes(version 3) P. N. Hilfinger

HIGH CARD FLUSH 1. Definitions

Pong Game. Intermediate. LPo v1

GLOSSARY OF BRIDGE TERMS

Welcome to Family Dominoes!

COMPUTING CURRICULUM TOOLKIT

SDC. AutoCAD LT 2007 Tutorial. Randy H. Shih. Schroff Development Corporation Oregon Institute of Technology

Welcome to the Brain Games Chess Help File.

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

Diet customarily implies a deliberate selection of food and/or the sum of food, consumed to control body weight.

Pro Xenon Mediathek Ltd. Game Description Lucky Dragon

High Point Communications Authorized dealer for USA Fleet Services

Content Page. Odds about Card Distribution P Strategies in defending

Intralot 318 West Adams Street Suite 1104 Chicago, IL Tel:

Unit 6.5 Text Adventures

MIDDLE GAME IN CHESS BY REUBEN FINE DOWNLOAD EBOOK : MIDDLE GAME IN CHESS BY REUBEN FINE PDF

POINTS TO REMEMBER Planning when to draw trumps

Bridgepad Swiss Team Guide 2010 BridgePad Company Version 2a BridgePad Swiss Team Manual2d-3c.doc. BridgePad Swiss Team Instruction Manual

CS 210 Fundamentals of Programming I Fall 2015 Programming Project 8

Overview... 3 Starting the Software... 3 Adding Your Profile... 3 Updating your Profile... 4

Overview. Equipment. Setup. A Single Turn. Drawing a Domino

MODEL IWTI-01

SUPER-COLLOSAL TITAN WARFARE

CATFISH BEND CASINOS, L.C. RULES OF THE GAME FOUR CARD POKER

ATeacherFirst.com. S has shown minimum 4 hearts but N needs 4 to support, so will now show his minimum-strength hand, relatively balanced S 2

Version User Guide

SEEM3460/ESTR3504 (2017) Project

Logging into Five9 Telephony

DISTRIBUTED AGILE STUDY GROUP (DASG) MINECRAFT SETUP GUIDE. (c) 2016 Agile Dimensions LLC

Operation Guide Internet Radio

2. A separate designated betting area at each betting position for the placement of the ante wager;

TABLE OF CONTENTS TEXAS HOLD EM... 1 OMAHA... 2 PINEAPPLE HOLD EM... 2 BETTING...2 SEVEN CARD STUD... 3

e-bos TM Version 2.1.x PowerPlay User s Manual June BOS TM 2.1.x Page 1 of 59

Acing Math (One Deck At A Time!): A Collection of Math Games. Table of Contents

Pianola User Guide for Players How to analyse your results, replay hands and find partners with Pianola

Activity 1: Play comparison games involving fractions, decimals and/or integers.

The A Z of Card Games. david parlett

POKER. Bet-- means an action by which a player places gaming chips or gaming plaques into the pot on any betting round.

Cashback Blackjack TO PLAY THE GAME. The objective of the game is to get closer to 21 than the dealer without going over.

Level 2 Create software components using Java (7266/ )

Lucky Leprechaun. 1. Overview. Game Rules (v1.2-28/06/2016) The goal is to obtain a winning combination on a winning line spread across the reels.

Table of Contents. Lock-Off Rooms

9 Video Poker Paytables in 1 Game Ultimate X Triple Play Draw Poker provides a rich selection of the most popular video poker paytables:

Tschau Sepp LOGIC Sub-Component

Board 1 : Dealer North : Nil All West North East South Pass 1H 2C 2NT Pass 4H All Pass

The Definitive User Guide

CATFISH BEND CASINOS RULES OF THE GAME THREE CARD POKER

WCS-D5100 Programming Software for the Icom ID-5100 Data

Effective Training Inc. Aug 2009

Transcription:

Author: Tian Ma Class: ECE 491 last modified May 4/2004 ECE 491 Final Project Multiplayer Internet Card Game Goal of the Project The goals for this project are to demonstrate, experience, and explore all aspects of Java Internet Programming. This project will concentrate on three main areas of Java Java communications (Sockets) Graphical User Interface (GUI) Object Oriented Implementation Other Advance Features Problem Statement: In today s world, many people would like to play games with 2 or more persons rather than playing with boring computers. However, to have people gather in one place to start a game is not always a suitable solution. Finding partners might also be a problem. Solution: This project, I implemented a multiplayer card game to allow players to play a card game across Internet so people will not need to worry about finding partners and gather people in one location to play the game. With Internet, they can play the game with people all over the world. Main Features of this Application A public chat room as a GUI allows people to communicate with others and see whom they want to play with in private rooms. Players are connected by socket connection People can choose to play games in 10 private rooms. A game can be play between 2-4 persons through the internet with socket connection. Each games in each of the private room can be play simultaneously. A separate chat engine is built in each private rooms. So that people can still communicate to each other while they are in the game. Communications in the private rooms are restricted to each room, so that there messages in each of the private rooms will not be display in main room.

Tian Ma ECE 491 Final Project: Multiplayer Card Game Program Architecture ClientServer Conn Server Thread Server Engine Server Interface Client Interface Static Commands Command Interpreter Client Engine Main Client Engine Sort Cards GameRules PlayInfo StartPlayer Cards Game Engine Game Game GUI methods GameGUI Game Room Info GameGUI Commands MainRoom GUI EntranceGUI Game Room Location

Explanations: The overall architecture is pretty much self-explanatory. Double arrow indicate bidirectional dependencies (dependent in both way). One arrow denotes single dependency. Instead of each of the classes I will explain some key classes since you can find all the explanations in the documentations. ). The game class basically implements the game. One can see there are many class associated with game. The TestServer class runs the server. The TestApplet.html is use for people to accessing the server. The client engine handle all the actions execute by the client (e.g. chat, enter game room, play cards, etc ). The server engine handle all the actions execute by the server. The client server connection connects the client engine and server engine through server interface and client interface respectfully. From the diagram above, first the clients access the TestApplet it will lead him to enter the entrance GUI, the action listener will sends actions to the Client Engine and the client engine will sends action to the client interface and so on following the diagram until the server gets it. After the server get the actions, it interpret what action to be taken (command interpreter), then perform the necessary tasks in the engine. If all goes well, players are connected and proceed to MainRoom GUI. The MainRoom GUI basically follows the same principles as it implements listeners and sends actions to the client engine, so as other GUI (e.g. game gui commands). So basically, the flow of the program is behave having a GUI listens the command sends to Client Engine and Client Engine performs all the actions. Game Introductions: The card game that I implemented is pronounce as Da Lao Er in Chinese, or translated in English as Big 2, or pronounce as Daifugo in Japanese, or translated in English as Big rich. This is a very popular card game in Asia. The reason I choose to implement this card game is that this is the only card game that I enjoy playing and play well. Whatever name you want to called it, all we care is how to play? There are so many rules of playing it. So I will have my own rules too. These are the rules that I normally playing with my friends Tian s Game Rules Game Objective The objective of the game is to be the first one to get rid of all of your cards by playing them. Cards can be played singly or in certain playable combinations. The first person who get rid of all the cards wins, while others score penalty points. This Game can be play by 2 4 players (4 players is the best).

Playing the game: The player who holds a diamond 3 (or the smallest card if less than 4 player) will begins and must play this card, either by itself or as part of a playable combination. The person to this player's right plays next, and follows the counter clockwise direction. N W E S At your turn you must either pass (play no cards) or beat the previous play by playing a higher combination of the same number of cards. Single card must be beat by single card, pairs must be beat by pairs, triples must be beat by triples, and 5 cards must beat 5 cards. This continues for several rounds if necessary, until all but one of the players pass in succession, or no one being able or willing to beat the last play. The person who played highest (all the others having passed) wins the turn and begins again by playing any card or legal combination of cards. You are never under any obligation to beat a card or set of cards just because you are able to - you may always choose to pass and keep your high cards for a better opportunity. Passing does not prevent you from playing when your turn comes round again. Card Ranking The ranking of the cards from smallest to largest are the following: 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < Jack < Queen < King < Ace < 2 Suits Ranking for the card have the same number the rank will define by the Suit diamonds<clubs<hearts<spades Notations: d diamond c club h hearts s - spades Playable Combinations: Single card

The ranking of the single cards from smallest to largest are the following: 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < Jack < Queen < King < Ace < 2 for the card have the same number, the rank will define by a Suit diamonds<clubs<hearts<spades For example, a 3d < heart 3h 2 cards (Pairs) A pair of cards who have the same number (faces). For example, a pair of 2s, pair of Jacks. The rank is determine by the rank of the cards. If the two pairs have the same number, their rank will be determine by their suits. For example, (jack d, jack h) < (jack c and jack s) 3 cards (Triples) Three cards of the same number. 3 Aces, 3 tens, etc. 5 cards Ranking: Straights<Flush<Full House<Four of a kind<straight Flush 1. A Straight consists of five cards of consecutive rank with mixed suits. A straight with higher ranks beats a lower one, irrespective of the suits of the cards. When the ranks are the same, the suit of the largest card determines which is higher. For example, 3d 4c 5d 6c 7d < 3c 4d 5c 6d 7s, since 7d<7s 2. A Flush consists of any five cards of the same suit. A flush in a higher suit beats a flush in a lower suit, irrespective of the ranks of the cards. Between two flushes in the same suit, the one with the largest card determines the rank of a flush. For example, 3d 5d 6d 7d 8d < 3d 6d 8d 9d 10d, since 8d<10d 3. A Full House consists of three cards of the same number and a pairs; between two full houses, the one whose triple is of higher rank is better. For example, 5d 5c 5s 6d 6d < 8d 8c 8h 3c 3s

4. Four of a kind (or quads) are made up of all four cards of the same number, plus any fifth card. The fifth card must be included - four equal cards by themselves are not a playable combination. Between two fours of a kind, the rank of the four cards determines which is higher. 5. A Straight Flush consists of five consecutive cards of the same suit, twos ranking below threes and aces ranking high or low, as in straights. The rank of the highest card determines which of two straight flushes is higher; between two equal ranked straight flushes, the one in the higher suit is better For example, 3d 4d 5d 6d 7d<3h 4h 5h 6h 7h Scores: The players other than the winner score penalty points for the cards remaining in their hands. If you have: 1-7 cards, one penalty point for each cards 8 9 cards, 2 points per card, total of 16, 18 points respectably 10 12 cards, 3 points per card cards, total of 30 33, 36 respectably 13 cards 4 points per card, total of 52 points, because you never played any cards at all. The winner, having no cards, gets no penalty points for the hand.

Step by Step Tutorial how to Run the program: Note: This project is tested on PC running with Windows XP Professional Edition, with Internet Information Service (IIS) installed. First compiled all the files and type at command prompt to start the server javac *.java java Test Server See below: Open up the TestApplet.html file, entrance frame should pop up see below: You can change the host address in the input textfield or use local host for default. I tested my program using localhost.

Now: Enter your name Click one of the icons below to enter, the image you clicked will be use to denote your identity later in the game Error handing will be alert by dialog boxes. For example, name length, server error, etc.

If you enter successfully, the entrance window should close and you should be able to enter main room Main Room In main room one can chat and communicate publicly. Simply type the messages in the input filed and clicked chat. The intention of this is to let people communicate and choose whom they want to play with. Each user can have a choice of 10 private game rooms, therefore a maximum 10 groups can be played through the server simultaneously. Once they enter the private game room, a game can be started, and they conversation will be fixed within their game room.

Clicked the buttons on the lower right to enter the game room. The following picture illustrated Prof.Pyo and I have joined. I am the 1 st person entered the game and name is label with (1stP). Until the game has started, other people who wish to entered are welcome until it hits the size limit which is 4. Now a new player Shashank has enter the game room wondering if anybody if the game room. But since Prof.Pyo and I are in the game room, therefore Shashank just sees himself in the main room.

Shashank sees 2 player in the game room 0, therefore he choose to enter game room too. Also another player name other who are also enter GameRoom0. Note: only 1 st person enters the game can start the game. In this case it s me, so I clicked the start button.

According to the rules, the one who hold the smallest card (3d) get s to play first then play in CCW direction. In this case, I am lucky in enough to play first. Notice my name is color white signal everybody it is my turn. There is no combination of diamond 3 I can only play with a single card, so I will play just a single card. Use a mouse to select the card, the card should pop up, if it s your turn and you are playing according to the rules. After clicking the button you card will be display in the center. Now my card has popped out. The next player who gets the turn is Prof. Pyo, since we play in the CCW direction, his name is colored white to signal his turn. (See below)

Since this is 3d (diamond 3), the smallest card everybody would like to beat this card. Below, Prof. Pyo will play 5 to beat this card.

Now the turn will be set to Shashank will all others are OBSERVER. We can continue to play this card until no body wants to beat this card. If they don t want to beat this card, they can click pass to give the turn to others. Let s consider Shashank click PASS. He will give the turn to other to play the card. Let s consider other and I also don t want to beat this card. Then Prof. Pyo win s the turn since no body is willing to beat his card. He can play whatever combination he wants to get rid of the cards. Now, Prof. Pyo play straights: 5 6 7 8 9

In this case, Shashank can beat him with straights 6 7 8 9 10, since the last card 10>9 to get rid of five cards.

Other can beat him with 8 9 10 J Q (see below)

I can beat her by full house, since full house > than any straights Following the same patterns. Consider I win the game.

Other players score penalty points depend on how many cards they have. 1 7 cards same points as number of cards 8 9 cards double their points on the number of cards, total of 16, 18 respectably. 10-12 cards triple their points on the number of cards, total of 30,33,36 respectably 13 cards 13*4=52 points Only I can restart the game by clicking start since I am the 1 st P. (see below) Click the Exit button on the game will go back to Mainroom, and click x on the frame will close the applet You can play this game with 2 persons and 3 persons following the same rules, however, I highly recommand playing by 4 persons since it is much challenging.

Illustration of two Person Game Illustration of 3 person Game

There are 10 game rooms available and each groups can be play simultaneously. Chatting in the game are private as their messages are showed with respect to their game rooms. Time (hours) spend on this project Weekly hours spend on final project Week of 3/7-3/13 8 Week of 3/14-3/20 12 Week of 3/21-3/27 25 Week of 3/28-4/3 15 Week of 4/11-4/17 16 Week of 4/18-4/24 28 Week of 4/25-4/31 8 Total hours 112 Conclusion: This multi-player card game project have demonstrated important aspects of Java Internet and especially how how people communicate through the internet using Java. This project is highly related to what we learned in our class. It captures almost every topics we have covered such as: GUI programming, Networking, Applets, Inheritance, and more. The game Da Lao Er is a card game that I really enjoy playing. Since my implementation is done in an Object Oriented way, it can be extended to play other card games as well with no hardship. Although this project took me 112 hours to complete, I truly enjoyed the entire process, except for debugging! This project enhanced my skills in Java and it built-up my confidence on what I can do with Java. Furthermore, it has demonstrated my thorough understanding of Java Internet programming and my ability to develop Java Internet application.

This document was created with Win2PDF available at http://www.daneprairie.com. The unregistered version of Win2PDF is for evaluation or non-commercial use only.