Here’s my solution (it’s the one from the book):
And here’s the link:
https://www.lodev.org/jstumble/?board=agerafxfeagafralfxxfrxlfagafralfllfe
Description: To understand this solution, you’ve got to realize that doubling a binary number is the same as shifting all the bits up one place. For instance:
(reading from the top bit to the bottom bit, left to right)
1100 = 3
0110 = 6
0011 = 12
So each ball that drops sets the value of the gear bits below it to whatever it was.