#Java, 274 bytes (includes Pluto!) <!-- language-all: lang-java --> static void p(String p,String l){String q="MeVeEaMaJuSaUrNePl";int w=q.indexOf(p.substring(0,2))/2,e=q.indexOf(l.substring(0,2))/2,m=1,t=e,d[]={5029,4140,7834,55039,64627,144895,162745,140538};long h=0;if(w>e){e=w;w=t;m=-1;}for(;e--!=w;)h+=d[e]*10000;System.out.print(h*m);} Input/Output: p("Mercury","Mars") --> 170030000 p("Mars","Mercury") --> -170030000 p("Earth","Earth") --> 0 Spaced and tabbed: static void p(String p,String l){ String q="MeVeEaMaJuSaUrNePl"; int w=q.indexOf(p.substring(0,2))/2, e=q.indexOf(l.substring(0,2))/2, m=1, t=e, d[]={5029,4140,7834,55039,64627,144895,162745,140538}; long h=0; if(w>e){ e=w; w=t; m=-1; } for(;e--!=w;) h+=d[e]*10000; System.out.print(h*m); }