Skip to content
← Back

Blackjack

A browser-based Blackjack game with an AI recommendation system. Monte Carlo simulation goes head to head with Basic Strategy to suggest your next move.

  • React
  • TypeScript
  • Python
  • FastAPI
Contributors
2
Built in
3 weeks

Overview

Built with Arturo Roman Morales. A playable Blackjack game where an AI advisor recommends whether to hit or stand on every decision.

What was built

A FastAPI backend deals cards through the Deck of Cards API and runs two strategies side by side: Monte Carlo, which simulates 1,000 playouts per decision, and a fixed Basic Strategy table keyed off your total and the dealer's card. The React and TypeScript frontend shows the table live and surfaces whichever move the AI recommends.

Architecture

React and Vite on the frontend, FastAPI and Python on the backend. The simulation engine and rule table both live in a single ai.py module, with a companion test script that runs batches of simulated games and reports win, loss, and push rates.