# Knock-out Whist [![Coverage Status](https://coveralls.io/repos/github/16Janis12/KnockOutWhist/badge.svg?branch=master)](https://coveralls.io/github/16Janis12/KnockOutWhist?branch=master) [![Build-Status-Master](https://teamcity.janis-eccarius.de/guestAuth/app/rest/builds/buildType:(id:KnockOutWhist_BuildAndTest),branch:master/statusIcon.png)](https://teamcity.janis-eccarius.de/viewType.html?buildTypeId=KnockOutWhist_BuildAndTest&branch=master) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=16Janis12_KnockOutWhist&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=16Janis12_KnockOutWhist)
## About the Game
Knock-out Whist is a trick-taking card game designed for 2 to 7 players. It uses a standard 52-card deck.
The objective is to win tricks. Players who fail to win at least one trick in a round are eliminated.
The game continues through several rounds until only one player remains.

The first player to be knocked out will receive one card in the next round and has a chance to re-enter the game if they win a trick during that round.

## How to Play
The dealer shuffles the deck and deals 7 cards to each player.
The dealer reveals the top card of the deck to determine the trump suit for the first round.
The player to the left of the dealer leads the first trick.
Each following player must play a card of the same suit, if possible. If they don’t have a card of that suit, they may discard any card or play a trump card.
The player who plays the highest card of the led suit (or highest trump card) wins the trick.
The winner of the trick leads the next one.
The round continues until all cards have been played.
The player who wins the most tricks in a round decides the trump suit for the next round.
Any player who fails to win a trick in a round is knocked out of the game. Play continues until only one player remains.
In each successive round, players are dealt one fewer card than in the previous round.

## Tie-breaker
If two or more players have an equal number of tricks, they each draw a random card from the deck and reveal it. The player with the highest card wins the tie and gets to choose the trump suit for the next round.

## Dog's Life
The first player knocked out receives a single card in the next round. If they win a trick, they are allowed to re-enter the game.
For each trick, this player can choose to either play or pass. If they choose not to play any trick during the round, they remain knocked out.
If they win a trick, they re-enter the game in the following round. When this happens, the player to their left will lead the next trick.

## About the project
This project is a Scala implementation of the Knock-out Whist card game. It is maintained by 2 students of the HTWG Konstanz.

Last stable build: [![Build-Status-Master](https://teamcity.janis-eccarius.de/app/rest/builds/buildType:id:KnockOutWhist_BuildAndTest/statusIcon.svg)](https://teamcity.janis-eccarius.de/viewType.html?buildTypeId=KnockOutWhist_BuildAndTest&branch=master)

Last development build: [![Build-Status-Dev](https://teamcity.janis-eccarius.de/app/rest/builds/buildType:id:KnockOutWhist_BuildAndTest,branch:name:development/statusIcon.svg)](https://teamcity.janis-eccarius.de/viewType.html?buildTypeId=KnockOutWhist_BuildAndTest&branch=development)

Gitea: [https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist)

GitHub (Mirror): [https://github.com/16Janis12/KnockOutWhist](https://github.com/16Janis12/KnockOutWhist)

SonarQube: [https://sonarcloud.io/project/overview?id=16Janis12_KnockOutWhist](https://sonarcloud.io/project/overview?id=16Janis12_KnockOutWhist)

Coveralls: [https://coveralls.io/github/16Janis12/KnockOutWhist](https://coveralls.io/github/16Janis12/KnockOutWhist)

## Licence
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.