Draft:101 okey

Okey is a popular Turkish board game that originated from the Rummy genre.

The tiles are available in four different colors and are numbered from 1 to 13, with eight tiles per number. There are also two special tiles without numbers – these are used as jokers. Okey has various rules, with "Düz" and "101" being the most popular. The number of players in a game of Okey depends on the version being played.

Rules
In Okey 101, four players compete in multiple rounds to achieve the lowest score. The player with the fewest points at the end of all rounds wins. Points are based on the numbers on the tiles left in a player's hand, and the game ends when there are no more tiles to draw or when a player completes their hand. The game consists of a set number of rounds, and each round continues until a player finishes their hand.

Getting Starte With The Game
In the game, a dealer is chosen to distribute 21 tiles to each player, and 22 tiles to the player on their right. The remaining tiles are placed facedown on the table, with one tile left face up to determine the joker (OKEY tile). The game proceeds counterclockwise, starting with the player to the right of the dealer, who has 22 tiles. On their turn, a player can either draw a tile from the stack or take the last discarded tile. The goal is to reach a total value of 101 with the sequences in hand. Once this total is reached, the player can lay down their hand and place the sequences on the table. If a player cannot lay down their hand, they must discard a tile to end their turn. Every player's turn must end with discarding a tile, even if they have laid down their entire hand.

Joker (Okey Tule and Riziko)
The OKEY tile, which serves as the joker, changes in each game. There are two joker tiles, also known as false jokers, and they represent the number immediately above the face-up tile. Jokers have a distinct appearance compared to other regular tiles. The true jokers, which can be any tile based on the face-up tile, are indicated by the numbers on the false jokers. For instance, if the indicator tile is a blue 5, the real jokers in the game are the two blue 6s

per and Hand out
If you want to add tiles to existing sets on the table, you must have already laid down your hand with a minimum of 101 points. In one turn, you can both lay down your hand and add tiles to other existing sets. If you pick up the last discarded tile, you are required to use it. If you haven't laid down your hand yet, you must do so immediately and incorporate the taken tile into one of your sets. You cannot keep the taken tile in your rack. If the taken tile cannot be used to form a set or lay down your hand, it is returned and you draw a tile from the stack. There are no penalty points for this error.

Pairs
You can also go out by gathering at least five pairs of tiles, where a pair is two identical tiles. If you use pairs to go out, you can't lay down a regular set for the remainder of the game. Nonetheless, you can add tiles to sets that other players have already laid down. If all four players lay down pairs in the same round, the round is canceled, and a new round starts. No one gets penalty points for this round.

Scoring
In order to conclude a round of the game, a player must play all the tiles from their rack and discard their final tile onto the table. If there are no tiles left in the stack and no player has completed their hand, the points of the tiles in each player's rack are tallied and recorded. Players who have not placed any tiles receive 202 points. If a player finishes the round by playing all their tiles, they receive -101 points. The other players receive penalty points equal to the value of the tiles left in their racks. If a player has not laid down any sets, they receive 202 penalty points. If a player finishes by discarding a joker as their last tile, the other players receive double the penalty points for the tiles in their racks. The player who finishes receives -202 points. The other players, if they have laid down tiles, count the points of the remaining tiles in their racks as penalty points. If they haven't laid down any sets, they receive 404 penalty points. If a player opts for pairs, the sets they lay down at the end of the round are counted as pairs. If the player who opted for pairs finishes the game, the penalty points of the other players are doubled. If another player finishes the game, the points of the remaining tiles in the hand of the player who opted for pairs are counted as double penalty points. If a player lays down their entire hand in one move, and none of the other players have laid down any sets, the points of all the remaining tiles are doubled. If the player who finishes the game discards a joker as the final tile, the points are doubled again. In this case, the player who finishes receives -404 points, while the other players receive 808 penalty points each. At the end of all rounds, the penalty points are added up, and the player with the lowest score is the winner.If a player lays down their entire hand in one move, and none of the other players have laid down any sets, the points of all the remaining tiles are doubled. If the player who finishes the game discards a joker as the final tile, the points are doubled again. In this case, the player who finishes receives -404 points, while the other players receive 808 penalty points each. At the end of all rounds, the penalty points are totaled, and the player with the lowest score is the winner.

Penalty points
In certain circumstances, players will incur an additional 101 penalty points, which will be added to their score at the conclusion of the round. These situations include failing to achieve a points total of 101 with laid down sets, discarding a tile that could have been added to an existing set, and taking back multiple tiles after adding them to existing sets on the table. It's important to note that players are only penalized for taking back their last discarded tile, and failing to incorporate jokers into sets results in receiving penalties for each remaining joker. Additionally, in the team version of the game, if a player draws and opens a tile from the other team, their team incurs the penalty.

Additional Rules
If there are no tiles remaining in the stack to draw from and a player still needs tiles to finish the game, they are allowed to use the indicator tile to complete their hand.

When a player picks a tile from the discard pile, they are required to use that tile, and the player who discarded it gets a penalty. For instance, if the discarded tile was a 6, the penalty would be 60 points. The player taking the tile must incorporate it into their hand.

If you pick a tile from the pile of discarded tiles, you have to place it on the table. In a team game, if you want your partner to have the tile, you can exchange the tile you picked from the discard pile with the same tile from your set and then place it on the table.

If the indicator stone is 13, the joker is determined as 1.

In a regular game, if the indicator tile is a fake joker (riziko) and a player finishes with a fake joker, they receive a deduction of -404 points, whereas, if they finish with a real joker, they receive a deduction of -202 points. Meanwhile, in a pairs game, finishing with a fake joker results in a deduction of -808 points, while finishing with a real joker results in a deduction of -404 points. These points are subtracted from the finishing player and added as penalty points to the players who do not finish.

At the start of the game, if a player wishes to begin with pairs, they need to announce "I have the indicator." They are then allowed to position the indicator tile next to any tile and utilize it to form the five pairs when starting with pairs.

if the first player has opened the game from the pair, the second player cannot take the player's stone.

You cannot use sets of the same number and color, such as having multiple blue 10 tiles. Additionally, sequences cannot continue from 13 to 1, like black 13, black 1, black 2. If a player finishes with pairs, the other players receive double the points of the tiles in their hands as penalty points.