https://github.com/wwi2196/card-arrangement-application
This Java application simulates a card game where players arrange a group of cards in their hands. The goal is to represent the sequence of cards using a single positional list, keeping cards of the same suit together.
https://github.com/wwi2196/card-arrangement-application
Last synced: 3 months ago
JSON representation
This Java application simulates a card game where players arrange a group of cards in their hands. The goal is to represent the sequence of cards using a single positional list, keeping cards of the same suit together.
- Host: GitHub
- URL: https://github.com/wwi2196/card-arrangement-application
- Owner: WWI2196
- License: mit
- Created: 2023-03-18T11:21:20.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-07T07:24:01.000Z (10 months ago)
- Last Synced: 2025-01-29T22:45:02.779Z (5 months ago)
- Language: Java
- Homepage:
- Size: 69.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Card Arrangement Application
This Java application simulates a card game where players arrange a group of cards in their hands. The goal is to represent the sequence of cards using a single positional list, keeping cards of the same suit together. The game involves four players, and each player receives cards during iterations. After the final deal, the players' hands are sorted by suit and value.
## Functionalities
### 1. `addACard(r, s)`
- Adds a new card with rank `r` and suit `s` to the player's hand[^5^][5].
- Time complexity: O(1)### 2. `playACard(s)`
- Removes and returns a card of suit `s` from the player's hand[^6^][6].
- If no card of suit `s` exists, removes and returns an arbitrary card.
- Time complexity: O(1)### 3. `iterator()`
- Returns an iterator for all cards currently in the hand.
- Allows traversal through the entire hand.### 4. `suitIterator(s)`
- Returns an iterator for all cards of suit `s` currently in the hand.
- Allows traversal through cards of a specific suit.