About The Game

Blackjack 21

This card game is a digital implementation of the classic casino game Blackjack, also known as 21. The goal is simple: beat the dealer without going over 21.

Game Rules

  • Each player starts with two cards. The dealer gets one face-up and one face-down card.
  • Number cards (2-10) are worth their face value. Face cards (Jack, Queen, King) are worth 10 points. Aces can be worth either 1 or 11 points, whichever is better for your hand.
  • Players can "Hit" to draw additional cards or "Stand" to keep their current hand.
  • If a player's hand exceeds 21 points, they "bust" and lose the round.
  • After the player stands, the dealer reveals their face-down card and must hit until their hand totals 17 or more points.
  • If the dealer busts, the player wins. Otherwise, the higher point total wins.
  • A "Blackjack" (an Ace with a 10, Jack, Queen, or King) pays 3:2 on the player's bet.
  • If both the player and dealer have the same point total, it's a "push" (tie) and the bet is returned.

About the Technology

This game is built using:

  • Next.js 15 - React framework for the frontend
  • TypeScript - For type-safe JavaScript
  • Tailwind CSS - For styling
  • Shadcn UI - For UI components
  • qrandom.io API - For truly random card shuffling

About the qrandom.io API

This game uses the qrandom.io API to get truly random shuffled decks of cards. The API provides quantum-generated randomness, ensuring fair and unpredictable gameplay.

API Endpoints Used

GET /api/random/deck

Shuffle a deck of cards

GET /api/random/deck/:resultId/show

Get a specific card from the deck

GET /api/random/deck/:resultId/all

Get all cards from the shuffled deck