SplasheryPlayground
Difference Engine, a still.

AI and Computing · Built from a recipe

Difference Engine

Charles Babbage designed Difference Engine No.

PlaygroundFire it

Splats
700,250 in its file
Shelf
AI and Computing
Kind
Built from a recipe
Your own
Your own polynomial
Sound
Yes
Hands-on
Yes
Licenses
Own work (made in the page)

Fire it at

How to play

Tap it to turn the crank. Hands-on: circle round the crank to turn it yourself.

Its controls

ControlKindRangeStart
Turn the crankTap
Turn the crankButton
Start at x =Setting

About it

Charles Babbage designed Difference Engine No. 2 in the 1840s to make mathematical tables. Its calculating section was built from his drawings in London in 1991. It uses finite differences: for squares 1, 4, 9, 16, the gaps are 3, 5, 7, and their gaps are always 2. Repeated addition can therefore find the next square without multiplying.

Tap to turn the crank once; tap again for another value. Wheels turn and carries ripple between digits while each difference adds into its neighbor. The starting example is x². In the Splash tab, choose the starting x and type a polynomial in x or n, up to degree three, that gives whole numbers, such as x³ or n(n + 1)/2. The splash has five-digit columns, so values wrap at 100,000; it is a small working illustration, not the full historical engine. With ✋ Hands-on on, circle round the crank with your finger: each full turn of your hand is one turn of the engine, at your pace, and its ratchet never lets it turn back.

Details

Splats
Opens at 200,000 at Mid Detail, 118,478 at Low, and up to 1,000,000 at Max

Is it right?

The addition-and-carry mechanism gives correct polynomial values modulo 100,000 for supported cubic inputs. Its historical dates are supported. The input validator can accept higher-degree expressions that match eight sampled points, after which the engine gives the wrong value.

  1. Correct

    Difference Engine No. 2 was designed in the 1840s and its calculating section was reconstructed in 1991.12

    The About text matches the 1847–1849 design and the Science Museum’s 1991 calculating engine.

  2. Correct

    Finite differences calculate polynomial values using additions and carries.1

    The actual phases match 128 independently evaluated cubic polynomials over 32 turns each, including wrap and every decimal carry.

  3. Simplified

    Five-digit values wrap at 100,000.1

    The implementation uses modulo 100,000; this deliberately differs from the full historical engine’s capacity.

  4. Being fixed

    The input reader reliably restricts expressions to degree three.1

    It checks only eight consecutive values. x² + (x−1)(x−2)…(x−8) passes at x=1, but the ninth value should be 40,401 while the machine produces 81.

  1. 1The engines, Computer History Museum
  2. 2A Modern Sequel, Computer History Museum
Simplified
Five decimal digits and third-order differences replace the historical engine’s 31 digits and seventh-order differences. Negative values are displayed modulo 100,000. Accepted inputs must not be assumed valid solely because their first eight values pass the current check.

Sources and credits

Made in Splashery. Its code is MIT.

Share it

This link opens it in the Playground. To put it on your own page, add the element and one script tag. Every option.

https://splashery.app/play/?toy=difference-engine<script type="module" src="https://splashery.app/play/src/element.js"></script> <splashery-toy toy="difference-engine"></splashery-toy>

Nearby in the collection