[Since John certainly doesn't like every HTML5-modul I make, I have to start a new post. Thanks John, for the flowers.]
Powers-Of-Two Clock as HTML5 demo.
This is perhaps one of the most complicated 'mathy' clocks I made and at the same time one of the simplest, so this needs some explanation.
For the clock's display the date and time's *single* digits are first coded into powers of two. That is: 18 is coded into 2^1 and 2^8, 27 into 2^2 and 2^7 and so on.
Now we use any number base out of 2-60 for the display of these numbers.
That is, if we use base 10:
18 -> (2^1 and 2^8) -> (2 and 256)
27 -> (2^2 and 2^7) -> (4 and 128)
so that 18:27 -> (2 256) : (4 128) ... (read the 'and' as space).
For any other number base out of 2-60 we simply encode these last decimal numbers into that base.
For example, if we use base 9:
18 -> (2^1 and 2^8) -> (2 and 256 -> (2 and 314) (= 3*9^2 + 1*9^1 + 4)
27 -> (2^2 and 2^7) -> (4 and 128 -> (4 and 152) (= 1*9^2 + 5*9^1 + 2)
Vice versa, when reading the display, we take for simplicity base 10 as intermediate.
First we convert the number to base 10 and take then the log2 to have the original digit, for example (read 'space' for 'and'):
(4 and 152) at base 9 -> (4 and 128) at base 10 -> ( log2(4) and log2(128)) = (2 and 7) = 27.
Sounds complicated, but it's not:
Take as base b=2. Then watch the display and tell the time. Yes you read from PowerOfTwo-coded-decimals displayed at base 2. Be sure, you can read the clock display at once! This base choice gives one of the simplest clock displays I ever made.
("It's funny", said my little nephew, "zero zeroes means zero!")
Look at it
frome here (EU) or
from here (US).