Skip to content

An implementation of the BerlinClock in Swift using Storyboards.

License

Notifications You must be signed in to change notification settings

halonsoluis/BerlinClock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipeline status Swift version Lines of Code Code Smells Bugs Maintainability Rating

Berlin Clock (Mengenlehreclock or Berlin Uhr)

The Mengenlehreuhr (German for "Set Theory Clock") or Berlin-Uhr ("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 Records upon its installation on 17 June 1975. Commissioned by the Senate of Berlin 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.

This characteristic clock tells the time using a series of illuminated coloured blocks and it's read from top to bottom.

Berlin-Uhr-1650-1705

  • The top big lamp - (yellow) - (blinks to show seconds and it's illuminated only on even seconds).

  • The first line - 4 lamps (red) - (each lamp represents five hours).

  • The second line - 4 lamps (red) - (each lamp represents one hour).

  • The third line - 11 lamps (yellow, every 3rd is red) - (each lamp represents five minutes).

  • The fourth line - 4 lamps (yellow) - (each lamp represents one minute).

The Kata

This kata has been used already for more than 9 years as of now (2021), and it's normally used on live coding sessions.

On the stage, the idea is to use Test Driven Development (TDD) and implement the core clock logic by returning a string representation of the time. This representation is based on the colors read from top to bottom. (Y or R or 0 (off))

For more dedicated exercises, as the current one, an implementation of a visual interface that would present the clock working on real time is also required.

How to Run

For running the project, follow the following steps:

  • Make sure you are on a mac and have the latest Xcode (currently Xcode 12.4)
  • Clone this repository into Xcode or via [email protected]:2021-DEV2-012/BerlinClock.git
  • Open the file /BerlinClock/BerlinClock.xcodeproj
  • Select BerlinClockMain as the schema to run and select any of the simulators available (If you have an Apple Silicon you can even run it as designed for iPad, but you will be required to insert a developer account and sign the build)
  • For a better experience, use an iPhone Simulator as the design is not adjusted for iPad and it looks a bit skewed.

Screenshot 2021-03-23 at 21 05 33 Screenshot 2021-03-24 at 01 40 29

References

About

An implementation of the BerlinClock in Swift using Storyboards.

Topics

Resources

License

Stars

Watchers

Forks