that type of machine is called a "Rube Goldberg" after the guy who made it famous. The principle is to use different things and the different laws of physics and motion to create an incredibly elaborate machine that does a simple job. They did a good job with theirs. The reason I know all of this is because I had to do one as a project for school. They are really fun to do.