aoakley.com

The Nine Billion Names of God in Javascript

This JavaScript program lists all sequences of letters from AAAAAAAAA through to ZZZZZZZZZ, excluding any with more than three identical concurrent letters. This is the sequence used in Arthur C Clarke's short story The Nine Billion Names of God, except that in his story, the sequence was in a Tibetan character set, rather than the Roman alphabet.

I wrote this program on 19th March 2008, the day Arthur C Clarke died.

This page and source code are public domain. I would welcome modified versions that are shorter, neater or more accurate. JavaScript is an especially poor choice of language for this task - it would fit into one line of Perl! Of particular interest, regarding accuracy, is the first string; since sequences of more than three idenitical concurrent letters are excluded, I calculate that the first valid name is "AAABAAABA". I have therefore started the program at this name, to avoid a long wait as the program starts as it works its way from "AAAAAAAAA". However, the program will have numerous other long waits as it hits other massive sequences of excluded names. The next single excluded name is "AAABAABBBB" and the next sequence of excluded names would start with "AAABABBBBA".

USE OF THIS PROGRAM IS AT YOUR OWN RISK. I WILL NOT ACCEPT ANY LIABILITY FOR THE CONSEQUENCES SHOULD YOU ALLOW THIS PROGRAM TO RUN TO COMPLETION.

Public Domain - Andrew Oakley - 2008-03-19

Top - More Computing Articles - Article Index - aoakley.com