Home > Uncategorized > Rabbits and Clocks

## Rabbits and Clocks

This post is inspired by a tweet from Clifford Pickover regarding Fibonacci clock.

I sought to simulate this clock. Note the pattern for a given times is not unique for the most part but this adds interest to changing patterns.

Here is the code of my attempt:
``` sc = Rectangle @@@ {{{2, 3}, {3, 4}}, {{2, 4}, {3, 5}}, {{0, 3}, {2, 5}}, {{0, 0}, {3, 3}}, {{3, 0}, {8, 5}}}; h[n_] := Module[{tu}, tu = Tuples[{0, 1}, 5]; Pick[tu, {1, 1, 2, 3, 5}.# == n & /@ tu]]; m[n_] := Module[{tu}, tu = Tuples[{0, 5}, 5]; Pick[tu, {1, 1, 2, 3, 5}.# == n & /@ tu]]; m[0] := {{0, 0, 0, 0, 0}}; h[0] := {{0, 0, 0, 0, 0}}; rh = # -> h[#] & /@ Range[0, 12]; rm = # -> m[#] & /@ Range[0, 55, 5]; col = {0 -> White, 1 -> Red, 5 -> Green, 6 -> Blue}; clck[hr_, mn_] := Module[{ch, cm, cl}, ch = RandomChoice[hr /. rh]; cm = RandomChoice[mn /. rm]; cl = (ch + cm) /. col; Graphics[Prepend[Riffle[cl, sc], EdgeForm[Black]]] ] tm = Rest@Tuples[{Range[0, 12], Range[0, 55, 5]}]; clcanim = Column /@ Thread[{clck @@@ tm, Row[{#1, ":", IntegerString[#2, 10, 2]}] & @@@ tm}]; ```
The animation was made from `clcanim`