# PokerHand

Represents a poker hand.

## Methods

### make\_histograms

Computes histograms for suits and hands.\
Creates attributes:\
suits: a histogram of the suits in the hand. ranks: a histogram of the ranks. sets: a sorted list of the rank sets in the hand.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_highcard

Returns True if this hand has a high card.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### check\_sets

Checks whether self.sets contains sets that are at least as big as the requirements in t.\
t: list of int

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_pair

Checks whether this hand has a pair.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_twopair

Checks whether this hand has two pair.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_threekind

Checks whether this hand has three of a kind.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_fourkind

Checks whether this hand has four of a kind.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_fullhouse

Checks whether this hand has a full house.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_flush

Checks whether this hand has a flush.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_straight

Checks whether this hand has a straight.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### in\_a\_row

Checks whether the histogram has n ranks in a row.\
hist: map from rank to frequency n: number we need to get to

#### Parameters

| name  | description | default |
| ----- | ----------- | ------- |
| self  |             |         |
| ranks |             |         |
| n     |             | 5       |

### has\_straightflush

Checks whether this hand has a straight flush.\
Clumsy algorithm.

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### has\_straightflush

Checks whether this hand has a straight flush.\
Better algorithm (in the sense of being more demonstrably correct).

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |

### classify

Classifies this hand.\
Creates attributes: labels:

#### Parameters

| name | description | default |
| ---- | ----------- | ------- |
| self |             |         |


---

# 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://kgisl.gitbook.io/lab3003/docs/pokerhand.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.
