• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
stevekrouse

stevekrouse

BlackJack

Public
Like
BlackJack
Home
Code
4
backend
5
frontend
3
README.md
index.ts
Branches
2
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
3/21/2025
Viewing readonly version of main branch: v23
View latest version
README.md

Blackjack Game

A fun Blackjack game implementation for Val Town with a twist - the "Booze" mechanic adds unpredictability to your gameplay!

Features

  • Classic Blackjack gameplay
  • Interactive card UI
  • "Booze" feature that increases your betting amount and adds randomness
  • Responsive design
  • Real-time score tracking

How to Play

  1. Click "Start New Game" to begin
  2. Choose to "Hit" (get another card) or "Stand" (end your turn)
  3. Try to get as close to 21 as possible without going over
  4. Click "Booze Up" to increase your bet multiplier, but beware of random behavior!

Technology Stack

  • Frontend: React 18 with TypeScript
  • Backend: Hono API framework on Deno
  • Hosting: Val Town

Game Rules

  • Standard Blackjack rules apply (Aces are 1 or 11, face cards are 10)
  • Dealer must draw until they have at least 17
  • The Booze feature increases your bet amount and may trigger automatic hits

Project Structure

├── backend/
│   ├── controllers/
│   │   └── gameController.ts    # API endpoints
│   ├── models/
│   │   ├── Card.ts              # Card interface
│   │   ├── GameState.ts         # Game state interface
│   │   └── Player.ts            # Player interface
│   ├── utils/
│   │   └── deckUtils.ts         # Deck utilities
│   ├── gameEngine.ts            # Game logic
│   └── index.ts                 # Backend entry point
├── frontend/
│   ├── components/
│   │   ├── App.tsx              # Main app component
│   │   ├── BlackjackTable.tsx   # Game table UI
│   │   ├── BoozeButton.tsx      # Booze mechanic UI
│   │   ├── BoozeMeter.tsx       # Booze level indicator
│   │   └── Scoreboard.tsx       # Score tracking
│   ├── index.html               # HTML template
│   └── index.tsx                # Frontend entry point
└── README.md

Enjoy the game! 🃏 🍺

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.