openjack is blackjack against the dealer, with no betting. Hit, stand, or split, and the game counts the hands you win and lose.

openjack is free, open source, and has no tracking.

How to play
#

Rules
#

  • Get a hand closer to 21 than the dealer’s without going over.
  • Number cards count their value, face cards count 10, and an Ace counts 1 or 11.
  • Hit or stand. A hand that reaches 21 stands on its own.
  • Split two cards of the same value into separate hands, up to four. Split Aces take one card each, and 21 on a split hand is not a blackjack.
  • The dealer checks for blackjack under an Ace or a ten before the hand is played, then draws to 17.
  • Each hand wins, loses, or ties the dealer. A tie is a push.
  • The status line counts wins and losses. Each split hand counts on its own, and a push counts as neither.
  • There is no betting, and no chips or other currency. Nothing is saved between sessions.

House rules
#

OptionValuesDefault
Decks1, or a 6-deck shoe6
Soft 17dealer stands, or hitsstands

These are set under Options in the menu, and apply from the next hand. The shoe is reshuffled between hands once three quarters of it has been dealt.

Controls
#

Mouse and keyboard, on computers and in desktop browsers:

InputAction
Click a buttonPlay the hand
H / S / PHit / Stand / Split
Enter / SpaceDeal, or start the next hand
EscapeBack to the menu. The game can be resumed
Alt+EnterToggle fullscreen
Up / Down, Enter / SpaceMenu navigation. Left / Right change a value in Options

Touch, on phones, tablets, and mobile browsers:

GestureAction
Tap a buttonPlay the hand
Tap the title bar or the status line, or two-finger tapBack to the menu. The game can be resumed
Tap a menu rowChoose it. In Options, a tap cycles the value
Swipe up / downMove the menu selection. Left / right change a value

Cards are dealt one at a time and the dealer’s hidden card turns over. The buttons appear once the cards have landed.

Where to play
#

  • Browser: play it here. Nothing to install.
  • iPhone and iPad: submitted to the App Store and pending review. iOS 15 or later.
  • Android: install the APK from the latest release. It is not on Google Play.
  • Windows, macOS, Linux: download the archive for your system from the latest release.

Technical details
#

Source code: github.com/dannyheskett/openjack, MIT license.

Code
#

  • Written in C.
  • The rules (src/game.c) and the table layout (src/layout.c) are platform-independent. Every platform uses them unchanged. Unit tests cover both and need no window.
  • Drawing, input, and audio use raylib 6.0 on Windows, macOS, Linux, Android, and the web. iOS uses its own Metal and UIKit backend with no raylib.
  • The cards are drawn, using the same card art as openklondike. Sound effects are synthesized at startup. The Nunito typeface is embedded in the binary. There are no asset files.
  • The browser version is the same C compiled to WebAssembly with Emscripten.

Layout
#

One layout serves every screen. Each frame the table is fitted to the window: the buttons sit in a band along the bottom or in a column down the side, and split hands take one row or two, whichever leaves the cards largest. It works in a desktop window and in both orientations on phones and tablets. Cards are one size for the whole screen, so nothing moves when a hand is split.

Recording
#

Desktop builds record the session to an H.264 MP4 file, one video frame per rendered frame, with no external tools. Turn on Record in the menu, or start with --record or --record <file>.mp4. Mobile and web builds do not include the recorder.

Builds and releases
#

Every push to main builds and publishes a release: Linux x86-64, macOS universal, Windows x64 and x86, an Android APK and App Bundle, an iOS .ipa, and the WebAssembly bundle. The .ipa is the App Store build and cannot be sideloaded. Build instructions are in the README.