War

Public domain classic

The simplest card game there is. Flip, compare and hope.

War

At a glance

Rules
War with one 52-card deck, split 26 and 26 between you and a bot. Aces are high
Choices
None. The order of the cards decides every flip
Controls
The Flip button, the Space bar, or tap your pile and then the Flip zone on the table
Auto-play
Flips for you every 0.45 seconds on Relaxed, 0.12 on Quick, or 0.02 with Fast mode on
Fast mode
Skips the card-turning animation
Saves
Games, wins and the biggest pile you have finished with, in this browser only
Cost
Free, no account

How this War plays

  • Each flip turns over the top card of both piles. The higher card takes both, with the ace above the king and the two lowest. Suits make no difference.
  • Cards won go to the bottom of the winner's pile in a shuffled order, so the order of each pile keeps changing.
  • Two cards of the same rank start a war. On the next flip each player lays three cards face down and turns a fourth face up, and the higher face-up card takes everything on the table. A second tie starts another war on top of the first.
  • A player with fewer than four cards when a war starts lays down all but one and turns that last card up.
  • Running out during a war hands the whole pile to the other player and ends the game. If both piles run out on the same tie, the result is shared.
  • The game ends when one player holds all 52 cards. At 5,000 flips it stops anyway: the bigger pile wins and equal piles share the result.
  • The table shows each pile's size, the flip count, wars won by each side and the longest chain of wars so far.

What 1,000 test games showed

The rule test dealt 1,000 seeded games and flipped each one to the end.

  • The shortest game took 18 flips, the middle game 220 and the longest 1,507. None came near the 5,000-flip limit.
  • You won 500 and the bot 500. No game ended in a shared result.
  • Every game had at least one war, and the busiest had 84. The longest chain was four wars in a row.

With Auto-play and Fast mode on, the browser check finished a game in about 10 seconds at desktop size (340 flips) and 7 seconds at phone size (233 flips).

Ways to play it

  • Flip by hand if you want to watch each battle and every war stack being laid out.
  • Turn on Auto-play to let a game run while you watch the counts. Bot speed sets how fast it goes, and has no effect without Auto-play.
  • Add Fast mode to see the result in seconds. You can switch Auto-play off at any point and carry on by hand.

For a card game where your choices change the result, try Go Fish or Gin Rummy.

Known limits

  • There is nothing to decide, so there is no difficulty setting and no strategy.
  • On a 390 by 844 screen the start panel is 575 pixels tall in a 548-pixel game frame, so scroll inside it to see all of it.
  • At 1280 by 720 the game frame is 848 pixels tall, which is more than the window shows. Scroll, or use Fullscreen.
  • Switching to another tab pauses the game and opens the menu.
  • Blocked storage means your results are not saved.

How it was built and checked

AI tool
Codex
First committed
2026-10-15, in a batch of nine card games, built in the same run as Crazy Eights and Go Fish
Size
One HTML file of 485 lines, no game libraries
Rounds of changes
1, from the build record
Checked at build
The build report: 702,643 rule checks, 300 complete simulated games with 87,673 flips (the longest 1,173), a run of the screen code against a stand-in page with storage blocked, and tap areas checked at four screen sizes. It lists visual quality, real pointer gestures, device layouts and animation smoothness as not verified
Checked since
2026-11-11: a new rule test for War alone (1,134,752 checks covering every pairing of ranks, wars, short piles, wars in a row, the 5,000-flip limit, 1,000 whole games and the screen code), the shared card test again (702,643 checks for War), and an automated browser check of the local build at 1280 by 720 and 390 by 844. Each time it pressed Play, flipped twice with the Flip button and once with Space, switched on Auto-play and Fast mode, waited for the result screen, and started again
Played on a phone
2026-11-11, a full game on a real phone before this page went live

Embed War on your site

Free to embed. Please keep the credit link.

<div style="position:relative;padding-top:75%;max-width:640px"><iframe src="https://aivibecodedgames.com/games/war/" title="War (free browser game)" style="position:absolute;inset:0;width:100%;height:100%;border:0" loading="lazy" allow="fullscreen" allowfullscreen></iframe></div>
<p><a href="https://aivibecodedgames.com/play/war/">Play War free</a> on AI Vibe Coded Games</p>

How it was vibe coded

ToolCodex
Rounds of changes: 1
First committed2026-10-15

The opening prompt

Make the card game War. A standard deck is split between you and the computer. Both flip the top card and the higher card (ace high) takes both. A tie starts a war: three cards face down and one face up, and wars can chain. The game ends when one player holds every card. To keep it from running forever, won cards go to the bottom of the winner's pile in a shuffled order, and after 5,000 flips the player with more cards wins. Include tap or Space to flip, an auto-play toggle, a fast mode, and a stats panel with cards each, wars won, and longest war. Make the flips and the war stack look good.

Game controls

  • Tap Flip or press Space
  • Turn on auto-play to watch a whole game
  • Fast mode skips the animation

The game brief includes touch controls for phones.

Open the game on its own

More games