Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THIS IS A JAVA FX PROBLEM Create a card game program, pisti. The user will play the game with the computer. The rules of the

THIS IS A JAVA FX PROBLEM

Create a card game program, pisti. The user will play the game with the computer. The rules of the game added below. Requirements: Create classes for appropriate objects such as deck, card, player (bot and person). Use ArrayLists, Arrays, exception handling. Create a GUI that displays the cards in the center, and the players cards. At the end of the game, the scores should be calculated and winner should be announced.

Introduction

Piti (pronounced "pishti"), is a popular Turkish card game, using a standard 52 card pack. The direction of play is counter-clockwise. Cards are played to a central pile, which can be captured by matching the previous card played or playing a jack. Points are scored for certain captured cards. The word "piti", which means "burnt", describes a capture of a pile containing only one card, for which extra points are scored. The dealer turns one card of the four in the center of the table face up, to start the discard pile. If it is a jack, the cards should be shuffled and start the game again.

The Play

The player to dealer's right begins, and the turn to play passes counter-clockwise (For our project the user will play, then bot plays). A turn consists of playing one card from your hand face up on top of the discard pile. If rank of the played card matches the rank of the previous card on the pile, the playing team captures the whole pile. The captured cards are stored face down in front of one member of the team. The next player will then start a new discard pile by playing a card face up to the empty table. Playing a jack also captures the whole pile, no matter what card is on top of it. If the played card is not a jack and is not equal to the previous top card of the pile, the played card is simply added to the top of the pile. The team which makes the first capture also gets the cards which were dealt to the center of the table. Both members of the capturing team can look at these cards, but the other team are not allowed to see them. When everyone has played their last four cards, any cards remaining in the discard pile are given to the last team that made a capture. The play of the hand is now over, and the teams score for the cards they have captured.

Piti

If the pile consists of just one card and the next player captures it by playing a matching card (not a jack), the capturing team scores a 10 point bonus for a piti. The capturing card is placed face up in the team's capture pile as a way of remembering the 10 points when scoring. If the pile consists of just a single jack and you capture it with another jack, this counts as a double piti, worth 20 points. A piti can happen at any stage of the game, except that you cannot score a piti for the very first card played by the player to dealer's right (capturing the original center cards) nor for the very last card played by the dealer (just before the hand is scored).

Scoring

Points are scored for particular cards, for the majority of cards, and for each piti as follows:

Each J,Q,K,10 - 1 point

Each ace - 1 -point

2 of clubs - 2 points

10 of diamonds - 3 points

Majority of cards - 3 points

Each piti - 10 points

Each J piti - 20 points

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Usability

Authors: Jakob Nielsen, Raluca Budiu

1st Edition

0133122131, 9780133122138

More Books

Students also viewed these Programming questions

Question

Express 0.179 Answered: 1 week ago

Answered: 1 week ago