# Hash Blackjack

Every block represents a card.

The blockchain transaction hash value is hexadecimal.

**Hexadecimal** (or hex) is a base 16 system used to simplify how binary is represented. A hex digit can be any of the following 16 digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F. Each hex digit reflects a 4-bit binary sequence.

&#x20;

Hash BlackJack takes 2 digits from the blockchain hash to calculate the card.

**Rank Digit**: From right to left, the first digit that has the valid value:<br>

Ace (1), 2, 3 , 4 , 5 , 6, 7 , 8, 9 , 10, Jack (b), Queen (c), King (d)

**Color Digit**: The digit left to Rank Digit for calculating the 4 colors: Clubs (0), Diamonds (1), Hearts (2), Spades (3)

&#x20;

&#x20;

How to calculate the 13 Ranks:

BetHash will find last qualified hexadecimal value in the transaction hash.

A qualified hexadecimal value: 1 to 9, a, b, c, d, 13 numbers in total.<br>

Ace (1), 2, 3 , 4 , 5 , 6, 7 , 8, 9 , 10, Jack (b), Queen (c), King (d)

&#x20;

Other values: 0, e, f will be skipped. For example:

![](https://bethash.zendesk.com/hc/article_attachments/360026750531/mceclip0.png)

&#x20;

How to calculate the 4 colors:

One digit before the Rank Digit, is the Color Digit: BetHash does a mode calculation of the hex value to get a result between 0 and 3.

For example:

a (hex) --> 10 (decimal) % 4 --> 2 (Hearts)

b (hex) --> 11 (decimal) % 4 --> 3 (Spades)

0 (hex) -->  0 (decimal) % 4 --> 0 (Clubs)

&#x20;

How the Blocks are decided

Action Block: in which your action transaction is sent to the blockchain.

Card Blocks: 1 block after the action block. The number of card blocks depends on what kind of action the player chooses.&#x20;

Game Flow

Right after the betting block X, the following 3 blocks will send 3 cards in the following orders:

X+1， X+3: two cards for player

X+ 2: one card for dealer

&#x20;

If players choose to split at Block X, Block X+1 and Block X+2 will send 2 more cards to players.

If player chooses to hit at Block X, Block X+1 will send 1 more card to players.

If player chooses to stand at Block X, Block X+1, X+2 ... will send card to dealer until dealer reaches more than 17.

&#x20;

BlackJack Game Rules

Ace: can be used as 1 or 11.

2 -10: face value

J - K: 10

BlackJack: Initial Hand of an Ace and any 10 point card

&#x20;

double: can double with a initial hand of 9, 10, 11

surrender: late surrender

Split: no split on aces

Dealer hits on soft 17.

&#x20;

Payout

Player BlackJack pays 6:5

Insurance pays 2:1

Player beats dealer pays 1:1


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bethash.io/how-to-play/hash-blackjack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
