by Yakk » Wed Apr 27, 2011 7:02 pm UTC
What tends to happen today is that an honest-to-goodness computer is put in those machines. A computer with more processing power than the entire world had in 1940.
It then waits for someone to push a button, and turns on some motors, as its primary function.
It also tends to have diagnostic modes, keeps track of inventory and cash levels, possibly communicates back to a home office via telephone to request service calls (I'm low on coke! I have too much money! Someone knocked me over!) -- but that is just bonus.
And that coke machine works much like the one you wrote up, with input from some source (quite possibly that looks JUST LIKE your keyboard to your program, simply because it makes it easier to debug without the hardware!), and a "magic function" that sends signals to hardware (which on a development machine, would probably be emulated somehow).
...
An "old fashioned" hardware coke machine with transistors is not that different than writing a computer program, at the logic level. There are extra details that are annoying.
An electronics course at the high school level might cover this. As an example, they might have you build a traffic light intersection, where lights turn on and off by some logic.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR
Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.