Old Russian measure of length: Difference between revisions
Content added Content deleted
(Small changes in D entry) |
(Updated D entry) |
||
Line 41: | Line 41: | ||
return writeln("Please provide args Value and Unit."); |
return writeln("Please provide args Value and Unit."); |
||
immutable magnitude = |
immutable magnitude = args[1].to!double; |
||
immutable meters = magnitude * factor[args[2]]; |
immutable meters = magnitude * factor[args[2]]; |
||
writefln("%s %s to:\n", args[1], args[2]); |
writefln("%s %s to:\n", args[1], args[2]); |
||
foreach (immutable key; factor.keys.schwartzSort!(k => factor[k])) |
|||
keys.schwartzSort!(k => factor[k], "a < b"); |
|||
foreach (key; keys) |
|||
writefln("%10s: %s", key, meters / factor[key]); |
writefln("%10s: %s", key, meters / factor[key]); |
||
}</lang> |
}</lang> |