fork(12) download
  1. void main()
  2. {
  3. import std.algorithm, std.range, std.conv, std.array, std.stdio, std.format;
  4.  
  5. string c1 = "#15293E";
  6. string c2 = "#012549";
  7.  
  8. string c = roundRobin(c1.dropOne.chunks(2), c2.dropOne.chunks(2))
  9. .map!(a => a.to!int(16)).array
  10. .chunks(2)
  11. .map!(a => ((a[0] + a[1]) / 2))
  12. .fold!((a,b) => a ~= "%.2X".format(b))("#");
  13.  
  14. writeln(c);
  15. }
Success #stdin #stdout 0s 16480KB
stdin
Standard input is empty
stdout
#0B2743