This place is intended to be a spin on the library described in Borges classic short story The Library of Babel.
The site has been inspired by Jonathan Basile's fantastic Library of Babel, which is one of my favorite sites and which I urge you to check out if you haven't already. My implementation differs mainly in that I took some more freedom to deviate from the source material:
  1. Instead of using hexagonal rooms, this library consists of square rooms with 4 exits each.
  2. I used an alphabet of 31 letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ .,!?
  3. The library contains each book of 1344000 letters, divided into 600 pages. This is a difference to the existing implementation, which contains each unique page, but not each unique book.
  4. The library is not infinite. In fact, you can visit its borders and corners.
I wanted to create a library that is "walkable", a space of such a vast size that it could as well be infinite, but whose boundaries (and center) you can actually access.
From west to east and from north to south, the library spans 31671999 rooms. That means that while in theory, you can traverse the library, trying to do so will prove futile. Your keyboard will probably crumble to dust before you reach the other end.

How does it work?

The library has 311344000 books, with each book being a sequence of 1344000 characters. This sequence is divided into two parts: each part represents one axis of the library, which I will call X and Y in the following. Each of those axes is a very large base-31 number,
AAAA...A is 0,
AAAA...B is 1,
and so on.
When you now move a room to the left (west), you actually decrement the X-axis number by one. When you move a room to the right (east), you increment the X-axis number by one. The same goes for the Y-axis. You can now already see, that by walking the library, you are actually modifying this book-length character sequence.

Above I said the sequence is divided into two parts. This is actually not entirely true: If we just split the sequence into two equally-sized parts, we could generate all possible sequences of characters by walking the library, but each room would correspond to exactly one book. That is why two characters in the sequence are reserved, which means they are not modified by changing the room. Instead, those 31*31=961 additional combinations of characters represent the choice of book you make in each room, by picking one of the 961 books among the 8 shelves. This way, by letting your feet choose one of the 31(1344000 - 2) rooms, and then picking one of the 961 books, you completely choose one of the 311344000 unique book-length sequences.
A mental picture that I very like, is that in the library, you walk a space of possible incarnations of a single book.

If the character sequence that is determined this way would be converted "as is" to the book that you actually open and read, the library would be pretty boring and predictable. To illustrate, the X=0 Y=0 coordinate, which is the top-left room, would be a sequence of 1344000 - 2 'A's and 2 other characters chosen by picking the book. If we just take this sequence as the final book, all of the books in the room and in all rooms nearby would consist almost completely of 'A's.

What actually happens is that the book determined by the room's coordinates and your choice among the 961 books is fed through various scrambling functions that modify and re-arrange the character sequence. This way, even adjacent books on the same shelf look completely different.

Since the whole process is reversible, we can actually search the library for specific text (limited to the 31 character alphabet of the library).

You can find the source code here.

~~~

Have fun exploring!

Tom