Add spin session functionality and update game mechanics
- Introduced a new `spin_sessions` table to track user spin activities. - Updated the API to include a new endpoint for spinning games, allowing users to place bets and specify spin counts. - Enhanced game information structure and added validation for bets and spin counts. - Implemented the `Forest Fortune` slot game mechanics, including payline evaluation and scatter functionality. - Updated dependencies in `pyproject.toml` for development and added `httpx` for HTTP requests. - Added unit tests for the new slot mechanics and API endpoints to ensure functionality and reliability.
This commit is contained in:
24
app/slots/rng.py
Normal file
24
app/slots/rng.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
from typing import Any, Protocol, Sequence
|
||||
|
||||
|
||||
class Rng(Protocol):
|
||||
def random(self) -> float: ...
|
||||
|
||||
def choices(
|
||||
self,
|
||||
population: Sequence[Any],
|
||||
weights: Sequence[float] | None = None,
|
||||
*,
|
||||
k: int = 1,
|
||||
) -> list[Any]: ...
|
||||
|
||||
|
||||
def system_rng() -> random.SystemRandom:
|
||||
return random.SystemRandom()
|
||||
|
||||
|
||||
def seeded_rng(seed: int | str | bytes | bytearray) -> random.Random:
|
||||
return random.Random(seed)
|
||||
Reference in New Issue
Block a user