(II) [Winnerstrack] Any language: Unit converter
We've seen a number of interesting submissions for the first version of the unit converter, but most of them have a number of limitations or assumptions.
Let's give it another try: Your program will receive an amount, a source unit, and a target unit. For example
3, cm, m
will means "how much is 3 cm in meters"
You can't ask the user what kind of unit (distance, time, etc) it is. Your program needs to be configured with a text file that includes conversions from one unit to another unit. It can't work by having all possible combinations - it needs to be able to find "paths" between any two units as long as such path exists.
For example 3,cm,s "how many seconds is 3 cm?"
is not possible, but your program needs to determine that by looking for a path and finding none, not by having the different units in different groups.
Remember that units can be combined => So m/s to km/h for example is possible, and some units are the combination of others, for example 1 ampere = 1 coulomb per second.