Abū al-'Iz Ibn Ismā'īl ibn al-Razāz al-Jazarī built a his castle clock, a most sophisticated water-powered astronomical clock, which has been called the earliest programmable analog computer.
"It was a complex device that was about 11 feet high, and had multiple functions alongside timekeeping. It included a display of the zodiac and the solar and lunar orbits, and a pointer in the shape of the crescent moon which travelled across the top of a gateway, moved by a hidden cart and causing automatic doors to open, each revealing a mannequin, every hour. It was possible to re-program the length of day and night everyday in order to account for the changing lengths of day and night throughout the year, and it also featured five robotic musicians who automatically play[ed] music when moved by levers operated by a hidden camshaft attached to a water wheel. Other components of the castle clock included a main reservoir with a float, a float chamber and flow regulator, plate and valve trough, two pulleys, crescent disc displaying the zodiac, and two falcon automata dropping balls into vases" (Wikipedia article on Al-Jazari, accessed 04-02-2009).