The Mengenlehreuhr (German for "Set Theory Clock") or Berlin Uhr (German for "Berlin Clock") is the first public clock in the world that tells the time by means of illuminated, coloured fields, for which it entered The Guinness Book of Records1 upon its installation on 17 June 1975. Commissioned by the Senate of Berlin2 and designed by Dieter Binninger, the original full-sized Mengenlehreuhr was originally located at the Kurfürstendamm on the corner with Uhlandstraße. After the Senate decommissioned it in 1995, the clock was relocated to a site in Budapester Straße in front of Europa-Center, where it stands today.

Mengenlehreuhr
The Mengenlehreuhr displaying 10:31.
Mengenlehreuhr
The Mengenlehreuhr displaying time from 16:50 to 17:05 in time lapse.

The Mengenlehreuhr consists of 24 lights which are divided into one circular blinking yellow light on top to denote the seconds, two top rows denoting the hours and two bottom rows denoting the minutes.

The clock is read from the top row to the bottom. The top row of four red fields denote five full hours each, alongside the second row, also of four red fields, which denote one full hour each, displaying the hour value in 24-hour format. The third row consists of eleven yellow-and-red fields, which denote five full minutes each (the red ones also denoting 15, 30 and 45 minutes past), and the bottom row has another four yellow fields, which mark one full minute each. The round yellow light on top blinks to denote even- (when lit) or odd-numbered (when unlit) seconds.

Given the photo of the clock above as an example, two fields are lit in the first row (five hours multiplied by two, i.e. ten hours), but no fields are lit in the second row. Therefore the hour value is 10. Six fields are lit in the third row (five minutes multiplied by six, i.e. thirty minutes), while the bottom row has one field on (plus one minute). Hence, the lights of the clock altogether tell the time as 10:31. Here are some more examples:

08:05 10:59 18:35 23:59

Note that the Mengenlehreuhr can indicate theoretically any point in time from midnight (00:00) until 24:59, which is beyond the upper limit 23:59 on a 24-hour clock. However, one minute past 23:59, all lamps on the Mengenlehreuhr are switched off at the start of a new day.

Assignment

Define a class Mengenlehreuhr that implements clocks of type Mengenlehreuhr in Python. This class must support at least the following methods:

Example

>>> clock = Mengenlehreuhr(10, 31)
>>> clock.lamps()
(2, 0, 6, 1)
>>> clock
Mengenlehreuhr(10, 31)
>>> print(clock)
 #### #### ---- ----
 ---- ---- ---- ----
# # # # # # - - - - -
 #### ---- ---- ----
>>> clock.updateHours()
Mengenlehreuhr(11, 31)
>>> clock.lamps()
(2, 1, 6, 1)
>>> clock.updateHours(9)
Mengenlehreuhr(20, 31)
>>> clock.lamps()
(4, 0, 6, 1)
>>> print(clock)
 #### #### #### ####
 ---- ---- ---- ----
# # # # # # - - - - -
 #### ---- ---- ----
>>> clock.updateMinutes()
Mengenlehreuhr(20, 32)
>>> clock.lamps()
(4, 0, 6, 2)
>>> clock.updateMinutes(42)
Mengenlehreuhr(21, 14)
>>> clock.lamps()
(4, 1, 2, 4)
>>> print(clock)
 #### #### #### ####
 #### ---- ---- ----
# # - - - - - - - - -
 #### #### #### ####
>>> clock.updateMinutes(165)
Mengenlehreuhr(23, 59)
>>> clock.lamps()
(4, 3, 11, 4)
>>> print(clock)
 #### #### #### ####
 #### #### #### ----
# # # # # # # # # # #
 #### #### #### ####
>>> clock.updateMinutes()
Mengenlehreuhr(0, 0)
>>> clock.lamps()
(0, 0, 0, 0)
>>> print(clock)
 ---- ---- ---- ----
 ---- ---- ---- ----
- - - - - - - - - - -
 ---- ---- ---- ----
>>> clock.updateHours(10).updateMinutes(17)
Mengenlehreuhr(10, 17)
>>> clock.lamps()
(2, 0, 3, 2)
>>> print(clock)
 #### #### ---- ----
 ---- ---- ---- ----
# # # - - - - - - - -
 #### #### ---- ----

>>> Mengenlehreuhr(42, 42)
Traceback (most recent call last):
AssertionError: invalid time

Epilogue

Feel free to play around with this interactive version of the Mengenlehreuhr.

The Mengenlehreuhr may be the key to the unsolved section of Kryptos3, a sculpture at the CIA headquarters.

Kryptos
Kryptos, a sculpture at C.I.A. headquarters in Langley, Virginia (US). The last of four messages embedded in Kryptos has baffled code breakers since the work went up in 1990. The sculptor, Jim Sanborn, gave a six-letter clue (Berlin) in 2010, but it did not lead to a solution. So he has offered another hint, this one five letters (Clock). "I figured maybe I should be a little more specific," he said.

After revealing that the part of the deciphered text in positions 64-69 of the sculpture reads BERLIN, the sculptor — Jim Sanborn — gave the New York Times another clue in November 2014, that letters 70–74 in part four of the sculpture's code (which read MZFPK) will become CLOCK when decoded. A direct reference to the Berlin Clock. Sanborn further stated that in order to solve section four

You'd better delve into that paricular clock.

However, Sandborn also said that

There are several really interesting clocks in Berlin.

Resources