Douglas Crockford

Blog

Books

Videos

2019 Appearances

JavaScript

JSLint

JSON

Github

How JavaScript Works

About

California Solitaire

California Solitaire is played with 52 playing cards. The playfield contains 4 regions:

After shuffling, 4 cards are layed out face up, forming the beginning of the 4 stacks. A fifth card is placed face up on the waste pile. The 4 foundations are initially empty.

The player may move one card at a time. The game is won when all of the towers are completed.

California Double Solitaire

The two players face each other, with 8 communal foundations between them. The players play independently and quickly, with their own decks, waste piles, and stacks. Either player make make valid placements on any of the foundations. The winner is the first player to place all of per cards on the towers. At the end of a game, at least four towers will be completed, and least one tower will not be completed.

A misplayed card is a forfeit.

The Towers of Hanoi

Knowledge of the Towers of Hanoi puzzle is useful for managing the stacks, moving cards from one stack to another to increase storage efficiency. The Towers of Hanoi is a complicated puzzle with a trivial recursive solution.

function hanoi(disc, source, aux, destination) {
    if (disc > 0) {
        hanoi(disc - 1, source, destination, aux);
        console.log("Move disc " + disc + " from " + source + " to " + destination);
        hanoi(disc - 1, aux, source, destination);
    }
}

Online Game

Click on the deck to draw another card to the waste pile.

Click on a card move it. The destination of the card is determined by an advanced blockchain enabled, social graft-driven artificial intelligence technology which will usually place the card where you want it. When it fails, just click the card again. Keep clicking and eventually it will move to the right place.

If you hold down the shift key (if you have one) whilst clicking on a card, it will go somewhere else instead, doing the opposite of the advanced blockchain enabled, social graft-driven artificial intelligence technology. That is usually what you want when you otherwise would not get what you want.