“As we travel the universe…”












45












$begingroup$


You'll be given the name of one of the 20 biggest objects in the Solar System. Your task is to return an approximation of its radius, expressed in kilometers.



This is a code-challenge where your score consists of the length of your code (in bytes) multiplied by a penalty ratio $ge 1$, based on your worst approximation. Therefore, the lowest score wins.



"As we travel the universe" is the last line of the song Planet Caravan by Black Sabbath, also later covered by Pantera.



The Solar System objects



Source: Wikipedia



NB: The rank is given for information only. The input is the name of the object.



  n | Object   | Radius (km)
----+----------+-------------
1 | Sun | 696342
2 | Jupiter | 69911
3 | Saturn | 58232
4 | Uranus | 25362
5 | Neptune | 24622
6 | Earth | 6371
7 | Venus | 6052
8 | Mars | 3390
9 | Ganymede | 2634
10 | Titan | 2575
11 | Mercury | 2440
12 | Callisto | 2410
13 | Io | 1822
14 | Moon | 1737
15 | Europa | 1561
16 | Triton | 1353
17 | Pluto | 1186
18 | Eris | 1163
19 | Haumea | 816
20 | Titania | 788


Or as copy-paste friendly lists:



'Sun', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Earth', 'Venus', 'Mars', 'Ganymede', 'Titan', 'Mercury', 'Callisto', 'Io', 'Moon', 'Europa', 'Triton', 'Pluto', 'Eris', 'Haumea', 'Titania'
696342, 69911, 58232, 25362, 24622, 6371, 6052, 3390, 2634, 2575, 2440, 2410, 1822, 1737, 1561, 1353, 1186, 1163, 816, 788


Your score



Let $R_n$ be the expected radius of the $n^{th}$ object and let $A_n$ be the answer of your program for this object.



Then your score is defined as:



$$S=leftlceil Ltimesmax_{1le i le20}left({maxleft(frac{A_i}{R_i},frac{R_i}{A_i}right)^2}right)rightrceil$$



where $L$ is the length of your code in bytes.



Example:



If the size of your code is $100$ bytes and your worst approximation is on the Moon with an estimated radius of $1000$ km instead of $1737$ km, then your score would be:



$$S=leftlceil 100times{left(frac{1737}{1000}right)^2}rightrceil=302$$



The lower, the better.



Recommended header for your answer:



Language, 100 bytes, score = 302


You can use this script to compute your score (first line = code length, next 20 lines = your outputs, from Sun to Titania).



Rules




  • You may take the name of the object in either full lowercase, full uppercase or exactly as described above (title case). Other mixed cases are not allowed.

  • The input is guaranteed to be one of the 20 possible names.

  • You may return either integers or floats. In both cases, the penalty must be computed directly with these values (not rounded values in case of floats).

  • You must return positive values.

  • Empty programs are not allowed.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    Sandbox (now deleted). Thanks to all who provided feedback, and especially xnor for helping fix the scoring formula.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 14:07






  • 1




    $begingroup$
    I see the scoring has been changed to the power of 2 for the diff? In that case my 100-byte exact answer is shorter than my 70-byte approximation (which scored 91 before, but now 117..)
    $endgroup$
    – Kevin Cruijssen
    Dec 5 '18 at 15:03






  • 1




    $begingroup$
    @KevinCruijssen The idea behind that was to prevent extremely short answers (basically returning 1 or 2 constants) to be penalized by a reasonable factor and potentially win against more sophisticated ones.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 15:10






  • 2




    $begingroup$
    I approve of the square in the scoring function. My previous best result was a score of 60 using 2 bytes to get 7512 for all test cases. I'll see if I dive into creating a MathGolf solution anytime soon, but it'll be hard to beat 05AB1E.
    $endgroup$
    – maxb
    Dec 6 '18 at 10:17






  • 2




    $begingroup$
    @maxb You'll have to beat Jelly's score of 37, not 05AB1E's score of 60 ;p
    $endgroup$
    – Kevin Cruijssen
    Dec 6 '18 at 10:55


















45












$begingroup$


You'll be given the name of one of the 20 biggest objects in the Solar System. Your task is to return an approximation of its radius, expressed in kilometers.



This is a code-challenge where your score consists of the length of your code (in bytes) multiplied by a penalty ratio $ge 1$, based on your worst approximation. Therefore, the lowest score wins.



"As we travel the universe" is the last line of the song Planet Caravan by Black Sabbath, also later covered by Pantera.



The Solar System objects



Source: Wikipedia



NB: The rank is given for information only. The input is the name of the object.



  n | Object   | Radius (km)
----+----------+-------------
1 | Sun | 696342
2 | Jupiter | 69911
3 | Saturn | 58232
4 | Uranus | 25362
5 | Neptune | 24622
6 | Earth | 6371
7 | Venus | 6052
8 | Mars | 3390
9 | Ganymede | 2634
10 | Titan | 2575
11 | Mercury | 2440
12 | Callisto | 2410
13 | Io | 1822
14 | Moon | 1737
15 | Europa | 1561
16 | Triton | 1353
17 | Pluto | 1186
18 | Eris | 1163
19 | Haumea | 816
20 | Titania | 788


Or as copy-paste friendly lists:



'Sun', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Earth', 'Venus', 'Mars', 'Ganymede', 'Titan', 'Mercury', 'Callisto', 'Io', 'Moon', 'Europa', 'Triton', 'Pluto', 'Eris', 'Haumea', 'Titania'
696342, 69911, 58232, 25362, 24622, 6371, 6052, 3390, 2634, 2575, 2440, 2410, 1822, 1737, 1561, 1353, 1186, 1163, 816, 788


Your score



Let $R_n$ be the expected radius of the $n^{th}$ object and let $A_n$ be the answer of your program for this object.



Then your score is defined as:



$$S=leftlceil Ltimesmax_{1le i le20}left({maxleft(frac{A_i}{R_i},frac{R_i}{A_i}right)^2}right)rightrceil$$



where $L$ is the length of your code in bytes.



Example:



If the size of your code is $100$ bytes and your worst approximation is on the Moon with an estimated radius of $1000$ km instead of $1737$ km, then your score would be:



$$S=leftlceil 100times{left(frac{1737}{1000}right)^2}rightrceil=302$$



The lower, the better.



Recommended header for your answer:



Language, 100 bytes, score = 302


You can use this script to compute your score (first line = code length, next 20 lines = your outputs, from Sun to Titania).



Rules




  • You may take the name of the object in either full lowercase, full uppercase or exactly as described above (title case). Other mixed cases are not allowed.

  • The input is guaranteed to be one of the 20 possible names.

  • You may return either integers or floats. In both cases, the penalty must be computed directly with these values (not rounded values in case of floats).

  • You must return positive values.

  • Empty programs are not allowed.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    Sandbox (now deleted). Thanks to all who provided feedback, and especially xnor for helping fix the scoring formula.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 14:07






  • 1




    $begingroup$
    I see the scoring has been changed to the power of 2 for the diff? In that case my 100-byte exact answer is shorter than my 70-byte approximation (which scored 91 before, but now 117..)
    $endgroup$
    – Kevin Cruijssen
    Dec 5 '18 at 15:03






  • 1




    $begingroup$
    @KevinCruijssen The idea behind that was to prevent extremely short answers (basically returning 1 or 2 constants) to be penalized by a reasonable factor and potentially win against more sophisticated ones.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 15:10






  • 2




    $begingroup$
    I approve of the square in the scoring function. My previous best result was a score of 60 using 2 bytes to get 7512 for all test cases. I'll see if I dive into creating a MathGolf solution anytime soon, but it'll be hard to beat 05AB1E.
    $endgroup$
    – maxb
    Dec 6 '18 at 10:17






  • 2




    $begingroup$
    @maxb You'll have to beat Jelly's score of 37, not 05AB1E's score of 60 ;p
    $endgroup$
    – Kevin Cruijssen
    Dec 6 '18 at 10:55
















45












45








45


6



$begingroup$


You'll be given the name of one of the 20 biggest objects in the Solar System. Your task is to return an approximation of its radius, expressed in kilometers.



This is a code-challenge where your score consists of the length of your code (in bytes) multiplied by a penalty ratio $ge 1$, based on your worst approximation. Therefore, the lowest score wins.



"As we travel the universe" is the last line of the song Planet Caravan by Black Sabbath, also later covered by Pantera.



The Solar System objects



Source: Wikipedia



NB: The rank is given for information only. The input is the name of the object.



  n | Object   | Radius (km)
----+----------+-------------
1 | Sun | 696342
2 | Jupiter | 69911
3 | Saturn | 58232
4 | Uranus | 25362
5 | Neptune | 24622
6 | Earth | 6371
7 | Venus | 6052
8 | Mars | 3390
9 | Ganymede | 2634
10 | Titan | 2575
11 | Mercury | 2440
12 | Callisto | 2410
13 | Io | 1822
14 | Moon | 1737
15 | Europa | 1561
16 | Triton | 1353
17 | Pluto | 1186
18 | Eris | 1163
19 | Haumea | 816
20 | Titania | 788


Or as copy-paste friendly lists:



'Sun', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Earth', 'Venus', 'Mars', 'Ganymede', 'Titan', 'Mercury', 'Callisto', 'Io', 'Moon', 'Europa', 'Triton', 'Pluto', 'Eris', 'Haumea', 'Titania'
696342, 69911, 58232, 25362, 24622, 6371, 6052, 3390, 2634, 2575, 2440, 2410, 1822, 1737, 1561, 1353, 1186, 1163, 816, 788


Your score



Let $R_n$ be the expected radius of the $n^{th}$ object and let $A_n$ be the answer of your program for this object.



Then your score is defined as:



$$S=leftlceil Ltimesmax_{1le i le20}left({maxleft(frac{A_i}{R_i},frac{R_i}{A_i}right)^2}right)rightrceil$$



where $L$ is the length of your code in bytes.



Example:



If the size of your code is $100$ bytes and your worst approximation is on the Moon with an estimated radius of $1000$ km instead of $1737$ km, then your score would be:



$$S=leftlceil 100times{left(frac{1737}{1000}right)^2}rightrceil=302$$



The lower, the better.



Recommended header for your answer:



Language, 100 bytes, score = 302


You can use this script to compute your score (first line = code length, next 20 lines = your outputs, from Sun to Titania).



Rules




  • You may take the name of the object in either full lowercase, full uppercase or exactly as described above (title case). Other mixed cases are not allowed.

  • The input is guaranteed to be one of the 20 possible names.

  • You may return either integers or floats. In both cases, the penalty must be computed directly with these values (not rounded values in case of floats).

  • You must return positive values.

  • Empty programs are not allowed.










share|improve this question











$endgroup$




You'll be given the name of one of the 20 biggest objects in the Solar System. Your task is to return an approximation of its radius, expressed in kilometers.



This is a code-challenge where your score consists of the length of your code (in bytes) multiplied by a penalty ratio $ge 1$, based on your worst approximation. Therefore, the lowest score wins.



"As we travel the universe" is the last line of the song Planet Caravan by Black Sabbath, also later covered by Pantera.



The Solar System objects



Source: Wikipedia



NB: The rank is given for information only. The input is the name of the object.



  n | Object   | Radius (km)
----+----------+-------------
1 | Sun | 696342
2 | Jupiter | 69911
3 | Saturn | 58232
4 | Uranus | 25362
5 | Neptune | 24622
6 | Earth | 6371
7 | Venus | 6052
8 | Mars | 3390
9 | Ganymede | 2634
10 | Titan | 2575
11 | Mercury | 2440
12 | Callisto | 2410
13 | Io | 1822
14 | Moon | 1737
15 | Europa | 1561
16 | Triton | 1353
17 | Pluto | 1186
18 | Eris | 1163
19 | Haumea | 816
20 | Titania | 788


Or as copy-paste friendly lists:



'Sun', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Earth', 'Venus', 'Mars', 'Ganymede', 'Titan', 'Mercury', 'Callisto', 'Io', 'Moon', 'Europa', 'Triton', 'Pluto', 'Eris', 'Haumea', 'Titania'
696342, 69911, 58232, 25362, 24622, 6371, 6052, 3390, 2634, 2575, 2440, 2410, 1822, 1737, 1561, 1353, 1186, 1163, 816, 788


Your score



Let $R_n$ be the expected radius of the $n^{th}$ object and let $A_n$ be the answer of your program for this object.



Then your score is defined as:



$$S=leftlceil Ltimesmax_{1le i le20}left({maxleft(frac{A_i}{R_i},frac{R_i}{A_i}right)^2}right)rightrceil$$



where $L$ is the length of your code in bytes.



Example:



If the size of your code is $100$ bytes and your worst approximation is on the Moon with an estimated radius of $1000$ km instead of $1737$ km, then your score would be:



$$S=leftlceil 100times{left(frac{1737}{1000}right)^2}rightrceil=302$$



The lower, the better.



Recommended header for your answer:



Language, 100 bytes, score = 302


You can use this script to compute your score (first line = code length, next 20 lines = your outputs, from Sun to Titania).



Rules




  • You may take the name of the object in either full lowercase, full uppercase or exactly as described above (title case). Other mixed cases are not allowed.

  • The input is guaranteed to be one of the 20 possible names.

  • You may return either integers or floats. In both cases, the penalty must be computed directly with these values (not rounded values in case of floats).

  • You must return positive values.

  • Empty programs are not allowed.







code-challenge approximation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 6 '18 at 12:37







Arnauld

















asked Dec 5 '18 at 14:05









ArnauldArnauld

75.3k691317




75.3k691317








  • 2




    $begingroup$
    Sandbox (now deleted). Thanks to all who provided feedback, and especially xnor for helping fix the scoring formula.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 14:07






  • 1




    $begingroup$
    I see the scoring has been changed to the power of 2 for the diff? In that case my 100-byte exact answer is shorter than my 70-byte approximation (which scored 91 before, but now 117..)
    $endgroup$
    – Kevin Cruijssen
    Dec 5 '18 at 15:03






  • 1




    $begingroup$
    @KevinCruijssen The idea behind that was to prevent extremely short answers (basically returning 1 or 2 constants) to be penalized by a reasonable factor and potentially win against more sophisticated ones.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 15:10






  • 2




    $begingroup$
    I approve of the square in the scoring function. My previous best result was a score of 60 using 2 bytes to get 7512 for all test cases. I'll see if I dive into creating a MathGolf solution anytime soon, but it'll be hard to beat 05AB1E.
    $endgroup$
    – maxb
    Dec 6 '18 at 10:17






  • 2




    $begingroup$
    @maxb You'll have to beat Jelly's score of 37, not 05AB1E's score of 60 ;p
    $endgroup$
    – Kevin Cruijssen
    Dec 6 '18 at 10:55
















  • 2




    $begingroup$
    Sandbox (now deleted). Thanks to all who provided feedback, and especially xnor for helping fix the scoring formula.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 14:07






  • 1




    $begingroup$
    I see the scoring has been changed to the power of 2 for the diff? In that case my 100-byte exact answer is shorter than my 70-byte approximation (which scored 91 before, but now 117..)
    $endgroup$
    – Kevin Cruijssen
    Dec 5 '18 at 15:03






  • 1




    $begingroup$
    @KevinCruijssen The idea behind that was to prevent extremely short answers (basically returning 1 or 2 constants) to be penalized by a reasonable factor and potentially win against more sophisticated ones.
    $endgroup$
    – Arnauld
    Dec 5 '18 at 15:10






  • 2




    $begingroup$
    I approve of the square in the scoring function. My previous best result was a score of 60 using 2 bytes to get 7512 for all test cases. I'll see if I dive into creating a MathGolf solution anytime soon, but it'll be hard to beat 05AB1E.
    $endgroup$
    – maxb
    Dec 6 '18 at 10:17






  • 2




    $begingroup$
    @maxb You'll have to beat Jelly's score of 37, not 05AB1E's score of 60 ;p
    $endgroup$
    – Kevin Cruijssen
    Dec 6 '18 at 10:55










2




2




$begingroup$
Sandbox (now deleted). Thanks to all who provided feedback, and especially xnor for helping fix the scoring formula.
$endgroup$
– Arnauld
Dec 5 '18 at 14:07




$begingroup$
Sandbox (now deleted). Thanks to all who provided feedback, and especially xnor for helping fix the scoring formula.
$endgroup$
– Arnauld
Dec 5 '18 at 14:07




1




1




$begingroup$
I see the scoring has been changed to the power of 2 for the diff? In that case my 100-byte exact answer is shorter than my 70-byte approximation (which scored 91 before, but now 117..)
$endgroup$
– Kevin Cruijssen
Dec 5 '18 at 15:03




$begingroup$
I see the scoring has been changed to the power of 2 for the diff? In that case my 100-byte exact answer is shorter than my 70-byte approximation (which scored 91 before, but now 117..)
$endgroup$
– Kevin Cruijssen
Dec 5 '18 at 15:03




1




1




$begingroup$
@KevinCruijssen The idea behind that was to prevent extremely short answers (basically returning 1 or 2 constants) to be penalized by a reasonable factor and potentially win against more sophisticated ones.
$endgroup$
– Arnauld
Dec 5 '18 at 15:10




$begingroup$
@KevinCruijssen The idea behind that was to prevent extremely short answers (basically returning 1 or 2 constants) to be penalized by a reasonable factor and potentially win against more sophisticated ones.
$endgroup$
– Arnauld
Dec 5 '18 at 15:10




2




2




$begingroup$
I approve of the square in the scoring function. My previous best result was a score of 60 using 2 bytes to get 7512 for all test cases. I'll see if I dive into creating a MathGolf solution anytime soon, but it'll be hard to beat 05AB1E.
$endgroup$
– maxb
Dec 6 '18 at 10:17




$begingroup$
I approve of the square in the scoring function. My previous best result was a score of 60 using 2 bytes to get 7512 for all test cases. I'll see if I dive into creating a MathGolf solution anytime soon, but it'll be hard to beat 05AB1E.
$endgroup$
– maxb
Dec 6 '18 at 10:17




2




2




$begingroup$
@maxb You'll have to beat Jelly's score of 37, not 05AB1E's score of 60 ;p
$endgroup$
– Kevin Cruijssen
Dec 6 '18 at 10:55






$begingroup$
@maxb You'll have to beat Jelly's score of 37, not 05AB1E's score of 60 ;p
$endgroup$
– Kevin Cruijssen
Dec 6 '18 at 10:55












20 Answers
20






active

oldest

votes


















27












$begingroup$


PowerShell, 3 bytes, score 3637





2e4


Try it online!



Very naive, boring, implementation; just returns 20000 no matter the input. Experimentation with things like special-casing the sun or using floating-point values instead of 2 all resulted in worse scores because the length of code increased enough to offset any size-comparison gains.






share|improve this answer









$endgroup$









  • 3




    $begingroup$
    That's all you need to know about KPI :)
    $endgroup$
    – mazzy
    Dec 5 '18 at 15:59






  • 12




    $begingroup$
    Why is this getting so many votes?!
    $endgroup$
    – Shaggy
    Dec 5 '18 at 23:43






  • 11




    $begingroup$
    @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
    $endgroup$
    – Kevin Cruijssen
    Dec 6 '18 at 8:43








  • 6




    $begingroup$
    It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
    $endgroup$
    – Elcan
    Dec 6 '18 at 10:37






  • 8




    $begingroup$
    People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
    $endgroup$
    – BradC
    Dec 6 '18 at 15:58



















24












$begingroup$


Jelly, 34 bytes, score = 37



OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*


Input is in uppercase, output is the power of 1.1 with the least error.



Try it online!



How it works



OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*  Main link. Argument: s (string)

O Ordinal; map the char in s to their code points.
"ERIS" -> [69,82,73,83]
Ḍ Undecimal; treat the result as an array of digits
in base 10 and convert it to integer.
[69,82,73,83] -> 69000+8200+730+83 = 78013
“⁸|5/!‘ Literal; yield [136, 124, 53, 47, 33].
%ƒ Fold the array by modulus, using the computed
integer as initial value.
78013 -> 78013%136%124%53%47%33 = 32
“RNFLOJMjs⁽u[USJ‘ Literal; yield [82, 78, 70, 76, 79, 74, 77, ...
106, 115, 141, 92, 117, 91, 85, 83, 74].
ị Retrieve the element from the array to the right,
at the index to the left.
Indexing is 1-based and modular.
32 = 16 (mod 16) -> 'J' = 74
1.1* Raise 1.1 to the computed power.
74 = 1.1**74 = 1156.268519450066





share|improve this answer











$endgroup$





















    19












    $begingroup$


    Java (JDK), 90 bytes, score = 97





    s->("ýCĄ (ᬺ!˂Fɍ".charAt(s.substring(2).chars().sum()%96%49%25)-7)*100


    Try it online!




    • This entry uses both undisplayable and multi-byte Unicode characters (but Java accepts them nevertheless). Check the TIO for the accurate code.

    • The input must be title-case.

    • This code rounds the values to the best multiple-of-100 (sometimes up, sometimes down) so that the last two digits can be skipped when encoded, and the value can then be approximated by multiplying by 100.

    • This entry uses various hashes to fit a 25 codepoints string (shortest string I could find).


    Credits




    • -48 score (-45 bytes) thanks to Kevin Cruijssen by encoding the radiuses (divided by 100) directly in a String instead of hardcoding them in an explicit int array..






    share|improve this answer











    $endgroup$









    • 3




      $begingroup$
      96 bytes & 103 score with the same output.
      $endgroup$
      – Kevin Cruijssen
      Dec 5 '18 at 18:54












    • $begingroup$
      Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
      $endgroup$
      – Olivier Grégoire
      Dec 5 '18 at 19:42












    • $begingroup$
      Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
      $endgroup$
      – Kevin Cruijssen
      Dec 5 '18 at 20:12












    • $begingroup$
      @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
      $endgroup$
      – Olivier Grégoire
      Dec 6 '18 at 9:39












    • $begingroup$
      Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
      $endgroup$
      – Neil
      Dec 6 '18 at 10:08



















    9












    $begingroup$

    Wolfram Language 114 103 97 88 86 82 bytes. score = 114 103 97 89 87 83 points



    (#&@@EntityValue[Interpreter["AstronomicalObject"]@#,"Radius"]/._String->507)1.61&


    At least 6 points saved thanks to Dennis, several more thanks to lirtosiast, and 6 more thanks to user202729.



    Although Mathematica can fetch solar system data (as well as much additional astronomical data), some minor tweaks are needed, as explained below.



    Interpreter[#,"AstronomicalObject"]& will return the entity (i.e. the machine computable object) associated with the term represented by #.



    EntityValue[AstronomicalObject,"Radius"] returns the radius, in miles, of the entity. In the case of "Haumea", the value, 816.27 (i.e. 507*1.61), is returned.



    Multiplication of the radius by 1.61 converts from miles to km. Decimal values, rather than integers, account for much less than 1% error, even in the most extreme case.



    [[1]] returns the magnitude without the unit, km. This was later changed to #&@@, yielding the same result.






    share|improve this answer











    $endgroup$









    • 1




      $begingroup$
      Another wolfram built in. Just like detecting downgoats
      $endgroup$
      – OganM
      Dec 6 '18 at 23:46












    • $begingroup$
      I would've answered this but I don't know the wolfram language lol
      $endgroup$
      – Quintec
      Dec 7 '18 at 1:29










    • $begingroup$
      Actually, this requires internet connection too (tested on 10.2)
      $endgroup$
      – user202729
      Dec 9 '18 at 6:03










    • $begingroup$
      @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
      $endgroup$
      – DavidC
      Dec 9 '18 at 14:24










    • $begingroup$
      @user202729 Built-in datasets are allowed, even if they have to be downloaded.
      $endgroup$
      – Dennis
      Dec 12 '18 at 3:11



















    7












    $begingroup$


    Python 3, score 95, 95 bytes





    lambda n:ord("ؙҢ򪀖ਏ𑄗ാᣣ४ঈ挒ឤ?̰ҋ??ۉՉ怮ܞ੊̔"[int(n,35)%87%52%24-1])


    Try it online!






    Python 3, score 133, 133 bytes





    lambda n:int(f'00e0{10**18+10**6}10x1h2411j4?00??811i1207wazxmwuvko?mw??xc1ze1ldyujz6zysi4?ob??k9lym6w'[int(n,35)%87%52%24-1::23],36)


    Try it online!






    share|improve this answer











    $endgroup$





















      5












      $begingroup$

      Powershell, 150 bytes, score 163





      ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]


      Test script:



      $f = {
      ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]
      }

      $penalty = @(
      ,("Sun" , 696342)
      ,("Jupiter" , 69911)
      ,("Saturn" , 58232)
      ,("Uranus" , 25362)
      ,("Neptune" , 24622)
      ,("Earth" , 6371)
      ,("Venus" , 6052)
      ,("Mars" , 3390)
      ,("Ganymede" , 2634)
      ,("Titan" , 2575)
      ,("Mercury" , 2440)
      ,("Callisto" , 2410)
      ,("Io" , 1822)
      ,("Moon" , 1737)
      ,("Europa" , 1561)
      ,("Triton" , 1353)
      ,("Pluto" , 1186)
      ,("Eris" , 1163)
      ,("Haumea" , 816)
      ,("Titania" , 788)
      ) | % {
      $s,$expected = $_
      $result = &$f $s
      $ratio = [Math]::Max($result/$expected, $expected/$result)
      $ratio*$ratio
      }
      $scriptLength = $f.ToString().Length - 2 # -4 if CRLF mode
      $penaltyMax = ($penalty|Measure-Object -Maximum).Maximum
      $score = $scriptLength * $penaltyMax
      "$score = $scriptLength * $penaltyMax"


      Output:



      162.113324228916 = 150 * 1.08075549485944


      Explanation:




      • Names contain letters only, radiuses contain digits and dots. So we can write all the data in a data string and perform a regexp search.

      • The script searches for all substrings from left to right and takes the last result found.

      • The input must be title-case to reduce the data string.

      • The end of line mode is LF only.


      Example:



      Titania         Triton         Titan
      -------------- ------------- -------------
      T -> 1.3 T -> 1.3 T -> 1.3
      Ti -> 2.5 Tr -> Ti -> 2.5
      Tit -> Tri -> Tit ->
      Tita -> Trit -> Tita ->
      Titan -> Triton -> Titan ->
      Titani -> .8
      Titania ->

      Result is .8 Result is 1.3 Result is 2.5




      Powershell, 178 bytes, score 178



      ($args|% t*y|?{'Su696342J69911S58232U25362N24622Ea6371V6052Ma3390G2634Ti2575Me2440C2410I1822M1737Eu1561T1353P1186E1163H816Titani788'-cmatch"$(($y+=$_))(d+)"}|%{+$Matches.1})[-1]





      share|improve this answer











      $endgroup$





















        4












        $begingroup$


        05AB1E, score 100 66 60 (100 61 56 bytes)



        •1∞²îc|I‰∍T‡sÇ3¡ò½в…»Ë•§•1ë£ñƒq£û¿’…•S£y¦¦ÇO96%49%25%èт*


        Port of @OlivierGrégoire's Java answer, so if you like this first answer, make sure to upvote him as well!

        Input in titlecase.



        Verify all test cases.






        05AB1E, score 100 (100 bytes)



        •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•§•3«8¹ØмS7Ç•S£.•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•3ôI2£Iθ«kè


        Input in full lowercase. Outputs the exact radius, so no penalty is added.



        Verify all test cases.



        Explanation:





        •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•
        # Compressed integer 696342699115823225362246226371605233902634257524402410182217371561135311861163816788
        § # Casted to string (bug, should have been implicitly..)
        •3«8¹ØмS7Ç• # Compressed integer 65555444444444444433
        S # Converted to a list of digits: [6,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3]
        £ # The first integer is split into parts of that size: ["696342","69911","58232","25362","24622","6371","6052","3390","2634","2575","2440","2410","1822","1737","1561","1353","1186","1163","816","788"]
        .•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•
        # Compressed string "sunjursanursneeeahvesmasgaetinmeycaoioomoneuatrnploershaatia"
        3ô # Split into parts of size 3: ["sun","jur","san","urs","nee","eah","ves","mas","gae","tin","mey","cao","ioo","mon","eua","trn","plo","ers","haa","tia"]
        I2£ # The first two characters of the input
        Iθ # The last character of the input
        « # Merged together
        k # Get the index of this string in the list of strings
        è # And use that index to index into the list of integers
        # (and output the result implicitly)


        See this 05AB1E tip of mine (sections How to compress large integers? and How to compress strings not part of the dictionary?) to understand how the compression used works.



        I did create a 70-bytes alternative which would map sun to 600,000; [jupiter,saturn] to 60,000; [uranus,neptune] to 30,000; [earth,venus] to 6,000; [mars,ganymede,titan,mercury,callisto] to 3,000; [io,moon,europa,triton,pluto,eris] to 1,500; and [haumea;titania] to 750. Unfortunately that got a score of 117. I will see if I can get below 100 with an alternative approach later.






        share|improve this answer











        $endgroup$









        • 1




          $begingroup$
          I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
          $endgroup$
          – Olivier Grégoire
          Dec 6 '18 at 10:36










        • $begingroup$
          @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
          $endgroup$
          – Kevin Cruijssen
          Dec 6 '18 at 10:52



















        4












        $begingroup$

        Mathematica, 57 bytes, score = 62 58



        -4 bytes/score thanks to lirtosiast!



        #&@@WolframAlpha[#<>" size km","Result"]]/._Missing->816&


        Just does a Wolfram Alpha lookup for the mean radius.






        share|improve this answer











        $endgroup$









        • 1




          $begingroup$
          Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
          $endgroup$
          – ASCII-only
          Dec 9 '18 at 4:37












        • $begingroup$
          @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
          $endgroup$
          – LegionMammal978
          Dec 9 '18 at 18:04










        • $begingroup$
          Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
          $endgroup$
          – ASCII-only
          Dec 10 '18 at 1:10












        • $begingroup$
          @ASCII-only If you're worried, you can always post a question on Meta.
          $endgroup$
          – LegionMammal978
          Dec 10 '18 at 2:05










        • $begingroup$
          @leg In that case the data can be used offline after downloading. In this case, it's not.
          $endgroup$
          – user202729
          Dec 11 '18 at 5:50



















        4












        $begingroup$


        Jelly, 28 bytes, score = 31



        “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ1.1*


        This uses a configurable hashing built-in that I added to Jelly at @lirtosiast's suggestion.



        Input is in titlecase, output is the power of 1.1 with the least error.



        Try it online!



        How it works



        This answer consists of merely two parts.




        • First, “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ uses the new built-in to map each of the 20 possible inputs to 15 different integers.

        • Then, 1.1* elevates 1.1 to the computed power.


        “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ is a literal; every non-quote character is replaced by it's 0-based index in Jelly's code page, yielding $[95, 95, 169, 55, 242], [82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$.



        The hashing built-in first maps $[95, 95, 169, 55, 242]$ to an integer by incrementing each number, then treating the result as the bijective base-250 digits integer and adding $1$. This yields $376510639244$.



        By halving and flooring this integer until the result is $0$, we get the sequence $[376510639244, 188255319622, 94127659811, 47063829905, dots, 5, 2, 1, 0]$, which has the forward differences $[188255319622, 94127659811, 47063829906, dots, 3, 1, 1]$.



        Next, we generate 64 64-bit integers by applying SHAKE256-4096 to the string representation of the internal representation of 's right argument, then chopping the resulting 4096 bits into 64 64-bit chunks.



        now computes the dot product of the 39 differences and the first 39 generated 64-bit integers, modulo $2^{64}$. This yields an integer in $[0, 2^{64})$.



        The list $[82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$ has length 15, so we multiply the generated integer by 15 and take the 64 higher bits of the result. This yields an integer in $[0, 15)$, which we use to index into the list.



        To find the appropriate hash configuration, I've used a brute-forcer in C that is part of the Jelly repo.






        share|improve this answer









        $endgroup$





















          3












          $begingroup$


          Python 2, 155 bytes, score = 155





          lambda p:int('G11KK54222111111XXNM8MCO37WQ53YXHE93V8BIF2IMH1WU9KPU2MLN    HGR'['uSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])/2::20],35)


          Try it online!



          Surprisingly well for this lazy solution... will look into improving as well. ;-)






          share|improve this answer











          $endgroup$





















            3












            $begingroup$


            Japt, 86 bytes, score = 94



            g5 ¥'i?788:[7*A³7*L6*LG²G²IIÉHÄDÑDÑCÑCÑGÄÄGÄGECC8]g`suj«a¨Ì¼và@ã/eÖô¶e©rp¤r`bU¯2)z)*L


            Try it for all inputs, Calculate the score, or Check the highest error



            Very similar to Olivier's original answer. Input is all lowercase.



            After various improvements to the output values, the current highest error is Venus at just over 4%.



            Explanation now that things are a bit more stable:



            ¤¥`Éa`?                             :If the fifth character of the input is 'i':
            788 : Output 788.
            : :Otherwise:
            [...] : From the array representing radii
            g : Get the value at the index:
            `...` : In the string representing names
            b : Find the first index where this string appears:
            U¯2) : The first two characters of the input
            z) : And divide it by two
            *L : Multiply that value by 100


            The string for the names is sujusaurneeavemagatimecaiomoeutrplerha compressed using Japt's built-in compression. The numbers representing the radii are calculated like so:



                                      My value | Actual value
            ---------+-------------
            7 * 10 ^ 3 = 7000 * 100 = 700000 | 696342
            7 * 100 = 700 * 100 = 70000 | 69911
            6 * 100 = 600 * 100 = 60000 | 58232
            16 * 16 = 256 * 100 = 25600 | 25362
            16 * 16 = 256 * 100 = 25600 | 24622
            64 = 64 * 100 = 6400 | 6371
            64 - 1 = 63 * 100 = 6300 | 6052
            32 + 1 = 33 * 100 = 3300 | 3390
            13 * 2 = 26 * 100 = 2600 | 2634
            13 * 2 = 26 * 100 = 2600 | 2575
            12 * 2 = 24 * 100 = 2400 | 2440
            12 * 2 = 24 * 100 = 2400 | 2410
            16 + 1 + 1 = 18 * 100 = 1800 | 1822
            16 + 1 = 17 * 100 = 1700 | 1737
            16 = 16 * 100 = 1600 | 1561
            14 = 14 * 100 = 1400 | 1353
            12 = 12 * 100 = 1200 | 1186
            12 = 12 * 100 = 1200 | 1163
            8 = 8 * 100 = 800 | 816
            788 = 788 | 788





            share|improve this answer











            $endgroup$





















              3












              $begingroup$

              Japt, 77 76 75 bytes, score = 75



              First pass at this; I wanted to try a 0 penalty solution to give myself a baseline to work off. Will come back to it tomorrow to see what improvements can be made, hopefully still for 0 penalty.



              Input is case-insensitive.



              n35 %87%52 g"..."ò)mc


              Try it or test all inputs



              The "..." represents a string containing many unprintables. The codepoints are:



              32,32,15,61,11,86,696,342,25,75,699,11,33,90,63,71,24,10,24,40,253,62,60,52,32,32,8,16,11,63,32,32,32,32,58,232,17,37,135,3,246,22,18,22,26,34,7,88


              To offer a quick explanation: the string gets split into chunks of 2 characters. We then index into that array using part of ovs' formula plus some index-wrapping and then map the 2 characters to their codepoints.




              • Saved a byte/point thanks to ETH


              54 bytes, score = 58



              A port of Olivier's solution.



              "ýCĄ (ᬺ!˂Fɍ"cU¤¬xc %96%49)-7 *L


              Test all inputs






              share|improve this answer











              $endgroup$













              • $begingroup$
                I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                $endgroup$
                – ETHproductions
                Dec 6 '18 at 4:14










              • $begingroup$
                @ETHproductions, that doesn't seem to work
                $endgroup$
                – Shaggy
                Dec 6 '18 at 12:41










              • $begingroup$
                Here's what I was thinking
                $endgroup$
                – ETHproductions
                Dec 6 '18 at 14:50










              • $begingroup$
                @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                $endgroup$
                – Shaggy
                Dec 6 '18 at 15:03



















              2












              $begingroup$


              PowerShell, 203 bytes, score 203





              param($a)if($a-eq'Titan'){2575;exit}(696342,69911,58232,25362,24622,6371,6052,3390,2634,2440,2410,1822,1737,1561,1353,1186,1163,816,788)["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".indexOf(-join$a[0..1])/2]


              Try it online!



              Very similar to Olivier's answer, now that I see it, but developed independently.






              share|improve this answer









              $endgroup$





















                2












                $begingroup$

                T-SQL, 203 bytes, score = 217



                SELECT IIF(v='Titan',26,SUBSTRING(value,3,4))*100
                FROM i,STRING_SPLIT('Ca24,Ea64,Er12,Eu16,Ga26,Ha8,Io18,Ju699,Ma34,Me24,Mo17,Ne246,Pl12,Sa582,Su6963,Ti8,Tr14,Ur254,Ve61',',')
                WHERE LEFT(v,2)=LEFT(value,2)


                Line breaks are for readability only.



                Input is taken via pre-existing table i with varchar column v, per our IO standards.



                Joins the input table to an in-memory table on the first two characters, and returns the remaining digits x100.



                Treats "Titan" as a special case using IIF.






                share|improve this answer









                $endgroup$





















                  2












                  $begingroup$


                  Ruby, 105 bytes, score 109





                  ->n{7E5/('!)"0 r&zZ&1#}3Mfh-~~d@'[0,j=" =1&%)AM<I>2,-B#($D  7@".index((n[1,9].sum%50+34).chr)].sum-j*32)}


                  Try it online!



                  If we divide 700000 by the radii, we get a sequence which increases reasonably linearly (though rather erratically). The increments in the table below can be approximated by the ASCII values of characters. The problem with this approach is it requires the input to be decoded to a value which orders the different names by size.



                  A minor issue is that the difference between Eris and Haumea is quite large. Three characters ~~d are required to encode this increment in ASCII only format. The planet-to-index string has two "ghost planet"spaces in it to pad the index.



                  700000/r    increment from previous
                  0.994774
                  9.960407 8.965633
                  11.95806 1.997657
                  27.45612 15.49805
                  28.28129 0.825178
                  109.2987 81.0174
                  115.0598 5.761118
                  205.4106 90.3508
                  264.3667 58.95612
                  270.4241 6.057335
                  285.3861 14.96199
                  288.9386 3.552524
                  382.1855 93.24692
                  400.8877 18.70223
                  446.0871 45.19939
                  514.6652 68.57806
                  587.1349 72.46972
                  598.7463 11.61144
                  853.3603 254.6139
                  883.6827 30.32245





                  share|improve this answer











                  $endgroup$





















                    1












                    $begingroup$


                    Charcoal, 101 bytes, score = 101



                    I⍘§⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²⁺§θ⁰§θχγ


                    Try it online! Link is to verbose version of code. Explanation:



                    ⁺§θ⁰§θχ


                    Take the 1st and 11th character (cyclically) of the input string and concatenate them.



                    ⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²


                    Look them up in the string SuJiSrUuNtEEVVMrGnTTMcClIIMoEpToPPEiHeTa split into pairs of characters.



                    §⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³


                    Split the string m.w'fv&J|"l|"e1 c& _c Ca ;e ;* 9a 9C 31 2; 0I .7 ,N ,7 (X (< into groups of three characters and take the corresponding group.



                    I⍘ ... γ


                    Decode the result as a base-95 number using the printable ASCII character set as the digits. Example: Io's 11th character is I, so we look up II and find it's the 13th largest object and its size is 31 which maps to 19 * 95 + 17 = 1822.






                    share|improve this answer











                    $endgroup$





















                      1












                      $begingroup$


                      Swift 4, 225 bytes, score = 241



                      Probably golfable a bunch more (maybe in the "Ga-Me-Ca" area?), but Swift is not often used (for a reason, maybe.)



                      func b(i:String){print(i=="Titan" ?2575:["Su":6963,"Ju":699,"Sa":582,"Ur":253,"Ne":246,"Ea":63,"Ve":60,"Ma":33,"Ga":26,"Me":24,"Ca":24,"Io":18,"Mo":17,"Eu":16,"Tr":14,"Pl":12,"Er":12,"Ha":8,"Ti":8][String(i.prefix(2))]!*100)}


                      and ungolfed



                      func size(ofAstralObject object: String) {
                      let objectToRadius = // Map size/100 of all objects to the first two chars
                      ["Su":6963,
                      "Ju":699,
                      "Sa":582,
                      "Ur":253,
                      "Ne":246,
                      "Ea":63,
                      "Ve":60,
                      "Ma":33,
                      "Ga":26,
                      "Me":24,
                      "Ca":24,
                      "Io":18,
                      "Mo":17,
                      "Eu":16,
                      "Tr":14,
                      "Pl":12,
                      "Er":12,
                      "Ha":8,
                      "Ti":8] // Ti is Titania, while Titan is treated differently

                      print(object == "Titan" ?
                      2575 : // If "Titan", print the exact size
                      objectToRadius[String(i.prefix(2))]!*100 // get the size from the map and multiply by 100
                      )
                      }


                      Try It Online!



                      I tried different "key sizes" for the map, but of course 1 has many clashes and using three chars doesn't give me i=="Titan" ?2575:'s 17 chars, since there's "Io" to manage (and it'll take more than 3 chars, I think).






                      share|improve this answer









                      $endgroup$





















                        1












                        $begingroup$

                        JavaScript (ES6), 152 bytes, score = 163



                        Well, it's a pretty standard solution, but I enjoyed the challenge anyway!



                        s=>s=='Titan'?2575:[6963,699,582,254,246,64,60,34,26,24,24,18,17,16,14,12,12,8,8]["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".match(s[0]+s[1]).index/2]*100


                        My Score:



                        Max. penalty ratio = 1.07068 for Triton
                        Score = ceil(152 x 1.07068) = 163


                        Try it Online!






                        share|improve this answer









                        $endgroup$





















                          1












                          $begingroup$


                          FALSE, 152 bytes, Score = 563



                          [911*.]^$0[~][1+^]#$$2=$4=8=||[2 0!]?$3=[764 0!]?$5=[$$69=86=|$[6]?~[2]?0!]?$6=[$$83=85=|$[46]?~[$72=$[1]?~[2]?]?0!]?$7=[$84=$[1]?~[52]?0!]?


                          Lazy answer using word lengths and first letters but my excuse is that I'm using a weird language



                          Try it online! (copy paste the code, hit show and then run)



                          [911*.]          {defines a function that multiplies a number by 911 and then prints it}
                          ^$0[~][1+^]# {counts the length of the name as it's input, also records the first char}
                          $$2=$4=8=||[1 0!]? {if the name is 2, 4, or 8 chars long print 911*2 (0! calls the function)}
                          $3=[764 0!]? {if name is 3 long print 911*764}
                          $5=[$$69=86=|$[6]?~[2]?0!]? {5 long? print 911*6 if it starts with E or V, otherwise *2}
                          $6=[$$83=85=|$[46]?~[ {6 long? print 911*46 if it starts with S or U, otherwise:}
                          $72=$[1]?~[2]? {if name starts with H print 911*1 else *2
                          ]?0!]?
                          $7=[$84=$[1]?~[26]?0!]? {7 long? print 1822*1 if it starts with NT otherwise *26 (for jupiter}


                          My results:



                          Sun       : 696004.00 penalty ratio = (696342.00 / 696004.00 )² = 1.00097
                          Jupiter : 47372.00 penalty ratio = (69911.00 / 47372.00 )² = 2.17795
                          Saturn : 41906.00 penalty ratio = (58232.00 / 41906.00 )² = 1.93095
                          Uranus : 41906.00 penalty ratio = (41906.00 / 25362.00 )² = 2.73014
                          Neptune : 47372.00 penalty ratio = (47372.00 / 24622.00 )² = 3.70166
                          Earth : 5466.00 penalty ratio = (6371.00 / 5466.00 )² = 1.35855
                          Venus : 5466.00 penalty ratio = (6052.00 / 5466.00 )² = 1.22591
                          Mars : 1822.00 penalty ratio = (3390.00 / 1822.00 )² = 3.46181
                          Ganymede : 1822.00 penalty ratio = (2634.00 / 1822.00 )² = 2.08994
                          Titan : 1822.00 penalty ratio = (2575.00 / 1822.00 )² = 1.99737
                          Mercury : 1822.00 penalty ratio = (2440.00 / 1822.00 )² = 1.79342
                          Callisto : 1822.00 penalty ratio = (2410.00 / 1822.00 )² = 1.74959
                          Io : 1822.00 penalty ratio = (1822.00 / 1822.00 )² = 1.00000
                          Moon : 1822.00 penalty ratio = (1822.00 / 1737.00 )² = 1.10026
                          Europa : 1822.00 penalty ratio = (1822.00 / 1561.00 )² = 1.36236
                          Triton : 1822.00 penalty ratio = (1822.00 / 1353.00 )² = 1.81343
                          Pluto : 1822.00 penalty ratio = (1822.00 / 1186.00 )² = 2.36008
                          Eris : 1822.00 penalty ratio = (1822.00 / 1163.00 )² = 2.45435
                          Haumea : 911.00 penalty ratio = (911.00 / 816.00 )² = 1.24640
                          Titania : 911.00 penalty ratio = (911.00 / 788.00 )² = 1.33655

                          Max. penalty ratio = 3.70166 for Neptune
                          Score = ceil(152 x 3.70166) = 563





                          share|improve this answer











                          $endgroup$













                          • $begingroup$
                            It seems like the optimal multiplier for your current code is $1634$.
                            $endgroup$
                            – Arnauld
                            Dec 12 '18 at 2:36










                          • $begingroup$
                            I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                            $endgroup$
                            – Terjerber
                            Dec 12 '18 at 2:52



















                          0












                          $begingroup$


                          Python 2, 89 bytes, Score = 234





                          lambda(p):39**4/'zzuSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])**2.18


                          Try it online!



                          Most answers posted appear to have used a "encode/decode" strategy. I wondered how well I could do by estimating the diameter of celestial bodies using a simple equation. It's been a fun exercise, but the moderate byte savings are more than made up for by the accuracy penalty.



                          The core of this solution is the estimating equation:



                          Radius = 39**4/x**2.18


                          where x is twice the rank order of the radius of the body.



                          I generate the value of x based on the input string using a modification of @Erik the Outgolfer's Python 2 solution. I saved a few bytes on his code by recasting my equations to work with [2..40] instead of [1..20].



                          The code for generating rank orders takes up more than 2/3 of the bytes of the whole solution. If anyone has a more compact way of generating ranks, this solution could be shortened further. Because of the accuracy penalty (around 2.6), the score would improve quite a bit.



                          Generating the Equation



                          I used statistical methods to search for simple equations to estimate the size of each body based on its rank. In part following up on the insights in @Level River St's Ruby solution and generalizing, I settled on equations of the form:



                          Radius = A/(Rank)**B


                          Working in R, I used linear models on the log of the radii to develop initial estimates, and then used non-linear optimization, seeding the optimization with the results of the linear models, to search for solutions that minimized the penalty function specified in the problem.



                          The estimated value of A in the above equation is seven digits, so I searched for a simple expression to save a couple of bytes. I looked for expressions of the form



                          x**y


                          for two digit x and 1 digit y (for a total of five bytes, saving two bytes, or about five points, given the penalty) that was not too different from the optimum value of A and did not inflate the penalty much, and ended up with the (otherwise inexplicable):



                          39**4





                          share|improve this answer









                          $endgroup$













                          • $begingroup$
                            The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                            $endgroup$
                            – lirtosiast
                            Dec 12 '18 at 6:15










                          • $begingroup$
                            @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                            $endgroup$
                            – CCB60
                            Dec 12 '18 at 14:13











                          Your Answer





                          StackExchange.ifUsing("editor", function () {
                          return StackExchange.using("mathjaxEditing", function () {
                          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
                          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
                          });
                          });
                          }, "mathjax-editing");

                          StackExchange.ifUsing("editor", function () {
                          StackExchange.using("externalEditor", function () {
                          StackExchange.using("snippets", function () {
                          StackExchange.snippets.init();
                          });
                          });
                          }, "code-snippets");

                          StackExchange.ready(function() {
                          var channelOptions = {
                          tags: "".split(" "),
                          id: "200"
                          };
                          initTagRenderer("".split(" "), "".split(" "), channelOptions);

                          StackExchange.using("externalEditor", function() {
                          // Have to fire editor after snippets, if snippets enabled
                          if (StackExchange.settings.snippets.snippetsEnabled) {
                          StackExchange.using("snippets", function() {
                          createEditor();
                          });
                          }
                          else {
                          createEditor();
                          }
                          });

                          function createEditor() {
                          StackExchange.prepareEditor({
                          heartbeatType: 'answer',
                          autoActivateHeartbeat: false,
                          convertImagesToLinks: false,
                          noModals: true,
                          showLowRepImageUploadWarning: true,
                          reputationToPostImages: null,
                          bindNavPrevention: true,
                          postfix: "",
                          imageUploader: {
                          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                          allowUrls: true
                          },
                          onDemand: true,
                          discardSelector: ".discard-answer"
                          ,immediatelyShowMarkdownHelp:true
                          });


                          }
                          });














                          draft saved

                          draft discarded


















                          StackExchange.ready(
                          function () {
                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f177021%2fas-we-travel-the-universe%23new-answer', 'question_page');
                          }
                          );

                          Post as a guest















                          Required, but never shown

























                          20 Answers
                          20






                          active

                          oldest

                          votes








                          20 Answers
                          20






                          active

                          oldest

                          votes









                          active

                          oldest

                          votes






                          active

                          oldest

                          votes









                          27












                          $begingroup$


                          PowerShell, 3 bytes, score 3637





                          2e4


                          Try it online!



                          Very naive, boring, implementation; just returns 20000 no matter the input. Experimentation with things like special-casing the sun or using floating-point values instead of 2 all resulted in worse scores because the length of code increased enough to offset any size-comparison gains.






                          share|improve this answer









                          $endgroup$









                          • 3




                            $begingroup$
                            That's all you need to know about KPI :)
                            $endgroup$
                            – mazzy
                            Dec 5 '18 at 15:59






                          • 12




                            $begingroup$
                            Why is this getting so many votes?!
                            $endgroup$
                            – Shaggy
                            Dec 5 '18 at 23:43






                          • 11




                            $begingroup$
                            @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
                            $endgroup$
                            – Kevin Cruijssen
                            Dec 6 '18 at 8:43








                          • 6




                            $begingroup$
                            It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
                            $endgroup$
                            – Elcan
                            Dec 6 '18 at 10:37






                          • 8




                            $begingroup$
                            People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
                            $endgroup$
                            – BradC
                            Dec 6 '18 at 15:58
















                          27












                          $begingroup$


                          PowerShell, 3 bytes, score 3637





                          2e4


                          Try it online!



                          Very naive, boring, implementation; just returns 20000 no matter the input. Experimentation with things like special-casing the sun or using floating-point values instead of 2 all resulted in worse scores because the length of code increased enough to offset any size-comparison gains.






                          share|improve this answer









                          $endgroup$









                          • 3




                            $begingroup$
                            That's all you need to know about KPI :)
                            $endgroup$
                            – mazzy
                            Dec 5 '18 at 15:59






                          • 12




                            $begingroup$
                            Why is this getting so many votes?!
                            $endgroup$
                            – Shaggy
                            Dec 5 '18 at 23:43






                          • 11




                            $begingroup$
                            @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
                            $endgroup$
                            – Kevin Cruijssen
                            Dec 6 '18 at 8:43








                          • 6




                            $begingroup$
                            It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
                            $endgroup$
                            – Elcan
                            Dec 6 '18 at 10:37






                          • 8




                            $begingroup$
                            People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
                            $endgroup$
                            – BradC
                            Dec 6 '18 at 15:58














                          27












                          27








                          27





                          $begingroup$


                          PowerShell, 3 bytes, score 3637





                          2e4


                          Try it online!



                          Very naive, boring, implementation; just returns 20000 no matter the input. Experimentation with things like special-casing the sun or using floating-point values instead of 2 all resulted in worse scores because the length of code increased enough to offset any size-comparison gains.






                          share|improve this answer









                          $endgroup$




                          PowerShell, 3 bytes, score 3637





                          2e4


                          Try it online!



                          Very naive, boring, implementation; just returns 20000 no matter the input. Experimentation with things like special-casing the sun or using floating-point values instead of 2 all resulted in worse scores because the length of code increased enough to offset any size-comparison gains.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 5 '18 at 14:56









                          AdmBorkBorkAdmBorkBork

                          27k366233




                          27k366233








                          • 3




                            $begingroup$
                            That's all you need to know about KPI :)
                            $endgroup$
                            – mazzy
                            Dec 5 '18 at 15:59






                          • 12




                            $begingroup$
                            Why is this getting so many votes?!
                            $endgroup$
                            – Shaggy
                            Dec 5 '18 at 23:43






                          • 11




                            $begingroup$
                            @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
                            $endgroup$
                            – Kevin Cruijssen
                            Dec 6 '18 at 8:43








                          • 6




                            $begingroup$
                            It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
                            $endgroup$
                            – Elcan
                            Dec 6 '18 at 10:37






                          • 8




                            $begingroup$
                            People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
                            $endgroup$
                            – BradC
                            Dec 6 '18 at 15:58














                          • 3




                            $begingroup$
                            That's all you need to know about KPI :)
                            $endgroup$
                            – mazzy
                            Dec 5 '18 at 15:59






                          • 12




                            $begingroup$
                            Why is this getting so many votes?!
                            $endgroup$
                            – Shaggy
                            Dec 5 '18 at 23:43






                          • 11




                            $begingroup$
                            @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
                            $endgroup$
                            – Kevin Cruijssen
                            Dec 6 '18 at 8:43








                          • 6




                            $begingroup$
                            It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
                            $endgroup$
                            – Elcan
                            Dec 6 '18 at 10:37






                          • 8




                            $begingroup$
                            People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
                            $endgroup$
                            – BradC
                            Dec 6 '18 at 15:58








                          3




                          3




                          $begingroup$
                          That's all you need to know about KPI :)
                          $endgroup$
                          – mazzy
                          Dec 5 '18 at 15:59




                          $begingroup$
                          That's all you need to know about KPI :)
                          $endgroup$
                          – mazzy
                          Dec 5 '18 at 15:59




                          12




                          12




                          $begingroup$
                          Why is this getting so many votes?!
                          $endgroup$
                          – Shaggy
                          Dec 5 '18 at 23:43




                          $begingroup$
                          Why is this getting so many votes?!
                          $endgroup$
                          – Shaggy
                          Dec 5 '18 at 23:43




                          11




                          11




                          $begingroup$
                          @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
                          $endgroup$
                          – Kevin Cruijssen
                          Dec 6 '18 at 8:43






                          $begingroup$
                          @Shaggy I'm confused about that as well.. :S It's by far the laziest and highest scoring answer (don't take it personal AdmBorkBork, but I think the Jelly and Java answers deserve the upvotes a lot more). People probably only see the 3 bytes part (or think higher score is better than lower) and ignore everything else. xD In Arnauld's original challenge description in the Sandbox, this answer wouldn't even have been possible, since it allowed a maximum error percentage of 95% for each I/O. Ah well. Enjoy the free rep AdmBorkBork. ;)
                          $endgroup$
                          – Kevin Cruijssen
                          Dec 6 '18 at 8:43






                          6




                          6




                          $begingroup$
                          It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
                          $endgroup$
                          – Elcan
                          Dec 6 '18 at 10:37




                          $begingroup$
                          It does fit the question's criterias though. I think people vote it because it's so obvious, many wouldn't have thought about it. It also denotes a challenge with a flawed rating system, if it can be abused that way.
                          $endgroup$
                          – Elcan
                          Dec 6 '18 at 10:37




                          8




                          8




                          $begingroup$
                          People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
                          $endgroup$
                          – BradC
                          Dec 6 '18 at 15:58




                          $begingroup$
                          People upvote on PPCG for all sorts of reasons, not just because of raw score (see my huge Minecraft redstone answer for example). I upvoted this answer because it is a clear, simple example of the far end of the spectrum of strategy (the spectrum between "return exact values" vs "save bytes to return an approximation and take the penalty").
                          $endgroup$
                          – BradC
                          Dec 6 '18 at 15:58











                          24












                          $begingroup$


                          Jelly, 34 bytes, score = 37



                          OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*


                          Input is in uppercase, output is the power of 1.1 with the least error.



                          Try it online!



                          How it works



                          OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*  Main link. Argument: s (string)

                          O Ordinal; map the char in s to their code points.
                          "ERIS" -> [69,82,73,83]
                          Ḍ Undecimal; treat the result as an array of digits
                          in base 10 and convert it to integer.
                          [69,82,73,83] -> 69000+8200+730+83 = 78013
                          “⁸|5/!‘ Literal; yield [136, 124, 53, 47, 33].
                          %ƒ Fold the array by modulus, using the computed
                          integer as initial value.
                          78013 -> 78013%136%124%53%47%33 = 32
                          “RNFLOJMjs⁽u[USJ‘ Literal; yield [82, 78, 70, 76, 79, 74, 77, ...
                          106, 115, 141, 92, 117, 91, 85, 83, 74].
                          ị Retrieve the element from the array to the right,
                          at the index to the left.
                          Indexing is 1-based and modular.
                          32 = 16 (mod 16) -> 'J' = 74
                          1.1* Raise 1.1 to the computed power.
                          74 = 1.1**74 = 1156.268519450066





                          share|improve this answer











                          $endgroup$


















                            24












                            $begingroup$


                            Jelly, 34 bytes, score = 37



                            OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*


                            Input is in uppercase, output is the power of 1.1 with the least error.



                            Try it online!



                            How it works



                            OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*  Main link. Argument: s (string)

                            O Ordinal; map the char in s to their code points.
                            "ERIS" -> [69,82,73,83]
                            Ḍ Undecimal; treat the result as an array of digits
                            in base 10 and convert it to integer.
                            [69,82,73,83] -> 69000+8200+730+83 = 78013
                            “⁸|5/!‘ Literal; yield [136, 124, 53, 47, 33].
                            %ƒ Fold the array by modulus, using the computed
                            integer as initial value.
                            78013 -> 78013%136%124%53%47%33 = 32
                            “RNFLOJMjs⁽u[USJ‘ Literal; yield [82, 78, 70, 76, 79, 74, 77, ...
                            106, 115, 141, 92, 117, 91, 85, 83, 74].
                            ị Retrieve the element from the array to the right,
                            at the index to the left.
                            Indexing is 1-based and modular.
                            32 = 16 (mod 16) -> 'J' = 74
                            1.1* Raise 1.1 to the computed power.
                            74 = 1.1**74 = 1156.268519450066





                            share|improve this answer











                            $endgroup$
















                              24












                              24








                              24





                              $begingroup$


                              Jelly, 34 bytes, score = 37



                              OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*


                              Input is in uppercase, output is the power of 1.1 with the least error.



                              Try it online!



                              How it works



                              OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*  Main link. Argument: s (string)

                              O Ordinal; map the char in s to their code points.
                              "ERIS" -> [69,82,73,83]
                              Ḍ Undecimal; treat the result as an array of digits
                              in base 10 and convert it to integer.
                              [69,82,73,83] -> 69000+8200+730+83 = 78013
                              “⁸|5/!‘ Literal; yield [136, 124, 53, 47, 33].
                              %ƒ Fold the array by modulus, using the computed
                              integer as initial value.
                              78013 -> 78013%136%124%53%47%33 = 32
                              “RNFLOJMjs⁽u[USJ‘ Literal; yield [82, 78, 70, 76, 79, 74, 77, ...
                              106, 115, 141, 92, 117, 91, 85, 83, 74].
                              ị Retrieve the element from the array to the right,
                              at the index to the left.
                              Indexing is 1-based and modular.
                              32 = 16 (mod 16) -> 'J' = 74
                              1.1* Raise 1.1 to the computed power.
                              74 = 1.1**74 = 1156.268519450066





                              share|improve this answer











                              $endgroup$




                              Jelly, 34 bytes, score = 37



                              OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*


                              Input is in uppercase, output is the power of 1.1 with the least error.



                              Try it online!



                              How it works



                              OḌ“⁸|5/!‘%ƒị“RNFLOJMjs⁽u[USJ‘1.1*  Main link. Argument: s (string)

                              O Ordinal; map the char in s to their code points.
                              "ERIS" -> [69,82,73,83]
                              Ḍ Undecimal; treat the result as an array of digits
                              in base 10 and convert it to integer.
                              [69,82,73,83] -> 69000+8200+730+83 = 78013
                              “⁸|5/!‘ Literal; yield [136, 124, 53, 47, 33].
                              %ƒ Fold the array by modulus, using the computed
                              integer as initial value.
                              78013 -> 78013%136%124%53%47%33 = 32
                              “RNFLOJMjs⁽u[USJ‘ Literal; yield [82, 78, 70, 76, 79, 74, 77, ...
                              106, 115, 141, 92, 117, 91, 85, 83, 74].
                              ị Retrieve the element from the array to the right,
                              at the index to the left.
                              Indexing is 1-based and modular.
                              32 = 16 (mod 16) -> 'J' = 74
                              1.1* Raise 1.1 to the computed power.
                              74 = 1.1**74 = 1156.268519450066






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Dec 6 '18 at 13:19

























                              answered Dec 5 '18 at 16:02









                              DennisDennis

                              188k32299738




                              188k32299738























                                  19












                                  $begingroup$


                                  Java (JDK), 90 bytes, score = 97





                                  s->("ýCĄ (ᬺ!˂Fɍ".charAt(s.substring(2).chars().sum()%96%49%25)-7)*100


                                  Try it online!




                                  • This entry uses both undisplayable and multi-byte Unicode characters (but Java accepts them nevertheless). Check the TIO for the accurate code.

                                  • The input must be title-case.

                                  • This code rounds the values to the best multiple-of-100 (sometimes up, sometimes down) so that the last two digits can be skipped when encoded, and the value can then be approximated by multiplying by 100.

                                  • This entry uses various hashes to fit a 25 codepoints string (shortest string I could find).


                                  Credits




                                  • -48 score (-45 bytes) thanks to Kevin Cruijssen by encoding the radiuses (divided by 100) directly in a String instead of hardcoding them in an explicit int array..






                                  share|improve this answer











                                  $endgroup$









                                  • 3




                                    $begingroup$
                                    96 bytes & 103 score with the same output.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 18:54












                                  • $begingroup$
                                    Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 5 '18 at 19:42












                                  • $begingroup$
                                    Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 20:12












                                  • $begingroup$
                                    @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 6 '18 at 9:39












                                  • $begingroup$
                                    Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
                                    $endgroup$
                                    – Neil
                                    Dec 6 '18 at 10:08
















                                  19












                                  $begingroup$


                                  Java (JDK), 90 bytes, score = 97





                                  s->("ýCĄ (ᬺ!˂Fɍ".charAt(s.substring(2).chars().sum()%96%49%25)-7)*100


                                  Try it online!




                                  • This entry uses both undisplayable and multi-byte Unicode characters (but Java accepts them nevertheless). Check the TIO for the accurate code.

                                  • The input must be title-case.

                                  • This code rounds the values to the best multiple-of-100 (sometimes up, sometimes down) so that the last two digits can be skipped when encoded, and the value can then be approximated by multiplying by 100.

                                  • This entry uses various hashes to fit a 25 codepoints string (shortest string I could find).


                                  Credits




                                  • -48 score (-45 bytes) thanks to Kevin Cruijssen by encoding the radiuses (divided by 100) directly in a String instead of hardcoding them in an explicit int array..






                                  share|improve this answer











                                  $endgroup$









                                  • 3




                                    $begingroup$
                                    96 bytes & 103 score with the same output.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 18:54












                                  • $begingroup$
                                    Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 5 '18 at 19:42












                                  • $begingroup$
                                    Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 20:12












                                  • $begingroup$
                                    @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 6 '18 at 9:39












                                  • $begingroup$
                                    Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
                                    $endgroup$
                                    – Neil
                                    Dec 6 '18 at 10:08














                                  19












                                  19








                                  19





                                  $begingroup$


                                  Java (JDK), 90 bytes, score = 97





                                  s->("ýCĄ (ᬺ!˂Fɍ".charAt(s.substring(2).chars().sum()%96%49%25)-7)*100


                                  Try it online!




                                  • This entry uses both undisplayable and multi-byte Unicode characters (but Java accepts them nevertheless). Check the TIO for the accurate code.

                                  • The input must be title-case.

                                  • This code rounds the values to the best multiple-of-100 (sometimes up, sometimes down) so that the last two digits can be skipped when encoded, and the value can then be approximated by multiplying by 100.

                                  • This entry uses various hashes to fit a 25 codepoints string (shortest string I could find).


                                  Credits




                                  • -48 score (-45 bytes) thanks to Kevin Cruijssen by encoding the radiuses (divided by 100) directly in a String instead of hardcoding them in an explicit int array..






                                  share|improve this answer











                                  $endgroup$




                                  Java (JDK), 90 bytes, score = 97





                                  s->("ýCĄ (ᬺ!˂Fɍ".charAt(s.substring(2).chars().sum()%96%49%25)-7)*100


                                  Try it online!




                                  • This entry uses both undisplayable and multi-byte Unicode characters (but Java accepts them nevertheless). Check the TIO for the accurate code.

                                  • The input must be title-case.

                                  • This code rounds the values to the best multiple-of-100 (sometimes up, sometimes down) so that the last two digits can be skipped when encoded, and the value can then be approximated by multiplying by 100.

                                  • This entry uses various hashes to fit a 25 codepoints string (shortest string I could find).


                                  Credits




                                  • -48 score (-45 bytes) thanks to Kevin Cruijssen by encoding the radiuses (divided by 100) directly in a String instead of hardcoding them in an explicit int array..







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Dec 6 '18 at 11:09

























                                  answered Dec 5 '18 at 15:14









                                  Olivier GrégoireOlivier Grégoire

                                  8,95511843




                                  8,95511843








                                  • 3




                                    $begingroup$
                                    96 bytes & 103 score with the same output.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 18:54












                                  • $begingroup$
                                    Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 5 '18 at 19:42












                                  • $begingroup$
                                    Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 20:12












                                  • $begingroup$
                                    @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 6 '18 at 9:39












                                  • $begingroup$
                                    Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
                                    $endgroup$
                                    – Neil
                                    Dec 6 '18 at 10:08














                                  • 3




                                    $begingroup$
                                    96 bytes & 103 score with the same output.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 18:54












                                  • $begingroup$
                                    Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 5 '18 at 19:42












                                  • $begingroup$
                                    Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
                                    $endgroup$
                                    – Kevin Cruijssen
                                    Dec 5 '18 at 20:12












                                  • $begingroup$
                                    @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
                                    $endgroup$
                                    – Olivier Grégoire
                                    Dec 6 '18 at 9:39












                                  • $begingroup$
                                    Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
                                    $endgroup$
                                    – Neil
                                    Dec 6 '18 at 10:08








                                  3




                                  3




                                  $begingroup$
                                  96 bytes & 103 score with the same output.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  Dec 5 '18 at 18:54






                                  $begingroup$
                                  96 bytes & 103 score with the same output.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  Dec 5 '18 at 18:54














                                  $begingroup$
                                  Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
                                  $endgroup$
                                  – Olivier Grégoire
                                  Dec 5 '18 at 19:42






                                  $begingroup$
                                  Thanks @KevinCruijssen! That's a nice golf, using unicode characters in a string instead of an array of decimal values. :-)
                                  $endgroup$
                                  – Olivier Grégoire
                                  Dec 5 '18 at 19:42














                                  $begingroup$
                                  Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  Dec 5 '18 at 20:12






                                  $begingroup$
                                  Glad I could help, and nice answer! :) PS: As for why I added the (...-7): The unprintable character (char)0 is empty so I had to add something. I first tried 9 and 8 being single digits, but 9 gave of course tabs, requiring multiple t (2 bytes each), and 8 gave an error about an unescaped character used.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  Dec 5 '18 at 20:12














                                  $begingroup$
                                  @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
                                  $endgroup$
                                  – Olivier Grégoire
                                  Dec 6 '18 at 9:39






                                  $begingroup$
                                  @KevinCruijssen To be honest, I tried for a few hours yesterday to get better values by expanding your multiplication into *100-700 and playing with the values-as-string and those two numbers, but those are the best, actually, Some values can decrease the byte count, but then the score stays the same. So random pinpointing made (one of) the best case ;)
                                  $endgroup$
                                  – Olivier Grégoire
                                  Dec 6 '18 at 9:39














                                  $begingroup$
                                  Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
                                  $endgroup$
                                  – Neil
                                  Dec 6 '18 at 10:08




                                  $begingroup$
                                  Talk about undisplayable! This entry really weirds out my Firefox to the point that I can't actually read the rest of the page properly :-(
                                  $endgroup$
                                  – Neil
                                  Dec 6 '18 at 10:08











                                  9












                                  $begingroup$

                                  Wolfram Language 114 103 97 88 86 82 bytes. score = 114 103 97 89 87 83 points



                                  (#&@@EntityValue[Interpreter["AstronomicalObject"]@#,"Radius"]/._String->507)1.61&


                                  At least 6 points saved thanks to Dennis, several more thanks to lirtosiast, and 6 more thanks to user202729.



                                  Although Mathematica can fetch solar system data (as well as much additional astronomical data), some minor tweaks are needed, as explained below.



                                  Interpreter[#,"AstronomicalObject"]& will return the entity (i.e. the machine computable object) associated with the term represented by #.



                                  EntityValue[AstronomicalObject,"Radius"] returns the radius, in miles, of the entity. In the case of "Haumea", the value, 816.27 (i.e. 507*1.61), is returned.



                                  Multiplication of the radius by 1.61 converts from miles to km. Decimal values, rather than integers, account for much less than 1% error, even in the most extreme case.



                                  [[1]] returns the magnitude without the unit, km. This was later changed to #&@@, yielding the same result.






                                  share|improve this answer











                                  $endgroup$









                                  • 1




                                    $begingroup$
                                    Another wolfram built in. Just like detecting downgoats
                                    $endgroup$
                                    – OganM
                                    Dec 6 '18 at 23:46












                                  • $begingroup$
                                    I would've answered this but I don't know the wolfram language lol
                                    $endgroup$
                                    – Quintec
                                    Dec 7 '18 at 1:29










                                  • $begingroup$
                                    Actually, this requires internet connection too (tested on 10.2)
                                    $endgroup$
                                    – user202729
                                    Dec 9 '18 at 6:03










                                  • $begingroup$
                                    @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
                                    $endgroup$
                                    – DavidC
                                    Dec 9 '18 at 14:24










                                  • $begingroup$
                                    @user202729 Built-in datasets are allowed, even if they have to be downloaded.
                                    $endgroup$
                                    – Dennis
                                    Dec 12 '18 at 3:11
















                                  9












                                  $begingroup$

                                  Wolfram Language 114 103 97 88 86 82 bytes. score = 114 103 97 89 87 83 points



                                  (#&@@EntityValue[Interpreter["AstronomicalObject"]@#,"Radius"]/._String->507)1.61&


                                  At least 6 points saved thanks to Dennis, several more thanks to lirtosiast, and 6 more thanks to user202729.



                                  Although Mathematica can fetch solar system data (as well as much additional astronomical data), some minor tweaks are needed, as explained below.



                                  Interpreter[#,"AstronomicalObject"]& will return the entity (i.e. the machine computable object) associated with the term represented by #.



                                  EntityValue[AstronomicalObject,"Radius"] returns the radius, in miles, of the entity. In the case of "Haumea", the value, 816.27 (i.e. 507*1.61), is returned.



                                  Multiplication of the radius by 1.61 converts from miles to km. Decimal values, rather than integers, account for much less than 1% error, even in the most extreme case.



                                  [[1]] returns the magnitude without the unit, km. This was later changed to #&@@, yielding the same result.






                                  share|improve this answer











                                  $endgroup$









                                  • 1




                                    $begingroup$
                                    Another wolfram built in. Just like detecting downgoats
                                    $endgroup$
                                    – OganM
                                    Dec 6 '18 at 23:46












                                  • $begingroup$
                                    I would've answered this but I don't know the wolfram language lol
                                    $endgroup$
                                    – Quintec
                                    Dec 7 '18 at 1:29










                                  • $begingroup$
                                    Actually, this requires internet connection too (tested on 10.2)
                                    $endgroup$
                                    – user202729
                                    Dec 9 '18 at 6:03










                                  • $begingroup$
                                    @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
                                    $endgroup$
                                    – DavidC
                                    Dec 9 '18 at 14:24










                                  • $begingroup$
                                    @user202729 Built-in datasets are allowed, even if they have to be downloaded.
                                    $endgroup$
                                    – Dennis
                                    Dec 12 '18 at 3:11














                                  9












                                  9








                                  9





                                  $begingroup$

                                  Wolfram Language 114 103 97 88 86 82 bytes. score = 114 103 97 89 87 83 points



                                  (#&@@EntityValue[Interpreter["AstronomicalObject"]@#,"Radius"]/._String->507)1.61&


                                  At least 6 points saved thanks to Dennis, several more thanks to lirtosiast, and 6 more thanks to user202729.



                                  Although Mathematica can fetch solar system data (as well as much additional astronomical data), some minor tweaks are needed, as explained below.



                                  Interpreter[#,"AstronomicalObject"]& will return the entity (i.e. the machine computable object) associated with the term represented by #.



                                  EntityValue[AstronomicalObject,"Radius"] returns the radius, in miles, of the entity. In the case of "Haumea", the value, 816.27 (i.e. 507*1.61), is returned.



                                  Multiplication of the radius by 1.61 converts from miles to km. Decimal values, rather than integers, account for much less than 1% error, even in the most extreme case.



                                  [[1]] returns the magnitude without the unit, km. This was later changed to #&@@, yielding the same result.






                                  share|improve this answer











                                  $endgroup$



                                  Wolfram Language 114 103 97 88 86 82 bytes. score = 114 103 97 89 87 83 points



                                  (#&@@EntityValue[Interpreter["AstronomicalObject"]@#,"Radius"]/._String->507)1.61&


                                  At least 6 points saved thanks to Dennis, several more thanks to lirtosiast, and 6 more thanks to user202729.



                                  Although Mathematica can fetch solar system data (as well as much additional astronomical data), some minor tweaks are needed, as explained below.



                                  Interpreter[#,"AstronomicalObject"]& will return the entity (i.e. the machine computable object) associated with the term represented by #.



                                  EntityValue[AstronomicalObject,"Radius"] returns the radius, in miles, of the entity. In the case of "Haumea", the value, 816.27 (i.e. 507*1.61), is returned.



                                  Multiplication of the radius by 1.61 converts from miles to km. Decimal values, rather than integers, account for much less than 1% error, even in the most extreme case.



                                  [[1]] returns the magnitude without the unit, km. This was later changed to #&@@, yielding the same result.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Dec 9 '18 at 14:22

























                                  answered Dec 5 '18 at 17:09









                                  DavidCDavidC

                                  24k243102




                                  24k243102








                                  • 1




                                    $begingroup$
                                    Another wolfram built in. Just like detecting downgoats
                                    $endgroup$
                                    – OganM
                                    Dec 6 '18 at 23:46












                                  • $begingroup$
                                    I would've answered this but I don't know the wolfram language lol
                                    $endgroup$
                                    – Quintec
                                    Dec 7 '18 at 1:29










                                  • $begingroup$
                                    Actually, this requires internet connection too (tested on 10.2)
                                    $endgroup$
                                    – user202729
                                    Dec 9 '18 at 6:03










                                  • $begingroup$
                                    @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
                                    $endgroup$
                                    – DavidC
                                    Dec 9 '18 at 14:24










                                  • $begingroup$
                                    @user202729 Built-in datasets are allowed, even if they have to be downloaded.
                                    $endgroup$
                                    – Dennis
                                    Dec 12 '18 at 3:11














                                  • 1




                                    $begingroup$
                                    Another wolfram built in. Just like detecting downgoats
                                    $endgroup$
                                    – OganM
                                    Dec 6 '18 at 23:46












                                  • $begingroup$
                                    I would've answered this but I don't know the wolfram language lol
                                    $endgroup$
                                    – Quintec
                                    Dec 7 '18 at 1:29










                                  • $begingroup$
                                    Actually, this requires internet connection too (tested on 10.2)
                                    $endgroup$
                                    – user202729
                                    Dec 9 '18 at 6:03










                                  • $begingroup$
                                    @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
                                    $endgroup$
                                    – DavidC
                                    Dec 9 '18 at 14:24










                                  • $begingroup$
                                    @user202729 Built-in datasets are allowed, even if they have to be downloaded.
                                    $endgroup$
                                    – Dennis
                                    Dec 12 '18 at 3:11








                                  1




                                  1




                                  $begingroup$
                                  Another wolfram built in. Just like detecting downgoats
                                  $endgroup$
                                  – OganM
                                  Dec 6 '18 at 23:46






                                  $begingroup$
                                  Another wolfram built in. Just like detecting downgoats
                                  $endgroup$
                                  – OganM
                                  Dec 6 '18 at 23:46














                                  $begingroup$
                                  I would've answered this but I don't know the wolfram language lol
                                  $endgroup$
                                  – Quintec
                                  Dec 7 '18 at 1:29




                                  $begingroup$
                                  I would've answered this but I don't know the wolfram language lol
                                  $endgroup$
                                  – Quintec
                                  Dec 7 '18 at 1:29












                                  $begingroup$
                                  Actually, this requires internet connection too (tested on 10.2)
                                  $endgroup$
                                  – user202729
                                  Dec 9 '18 at 6:03




                                  $begingroup$
                                  Actually, this requires internet connection too (tested on 10.2)
                                  $endgroup$
                                  – user202729
                                  Dec 9 '18 at 6:03












                                  $begingroup$
                                  @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
                                  $endgroup$
                                  – DavidC
                                  Dec 9 '18 at 14:24




                                  $begingroup$
                                  @user202729, Your last two, helpful, suggestions are now integrated. Use of curated entities, such as astronomical bodies, does indeed require internet connection.
                                  $endgroup$
                                  – DavidC
                                  Dec 9 '18 at 14:24












                                  $begingroup$
                                  @user202729 Built-in datasets are allowed, even if they have to be downloaded.
                                  $endgroup$
                                  – Dennis
                                  Dec 12 '18 at 3:11




                                  $begingroup$
                                  @user202729 Built-in datasets are allowed, even if they have to be downloaded.
                                  $endgroup$
                                  – Dennis
                                  Dec 12 '18 at 3:11











                                  7












                                  $begingroup$


                                  Python 3, score 95, 95 bytes





                                  lambda n:ord("ؙҢ򪀖ਏ𑄗ാᣣ४ঈ挒ឤ?̰ҋ??ۉՉ怮ܞ੊̔"[int(n,35)%87%52%24-1])


                                  Try it online!






                                  Python 3, score 133, 133 bytes





                                  lambda n:int(f'00e0{10**18+10**6}10x1h2411j4?00??811i1207wazxmwuvko?mw??xc1ze1ldyujz6zysi4?ob??k9lym6w'[int(n,35)%87%52%24-1::23],36)


                                  Try it online!






                                  share|improve this answer











                                  $endgroup$


















                                    7












                                    $begingroup$


                                    Python 3, score 95, 95 bytes





                                    lambda n:ord("ؙҢ򪀖ਏ𑄗ാᣣ४ঈ挒ឤ?̰ҋ??ۉՉ怮ܞ੊̔"[int(n,35)%87%52%24-1])


                                    Try it online!






                                    Python 3, score 133, 133 bytes





                                    lambda n:int(f'00e0{10**18+10**6}10x1h2411j4?00??811i1207wazxmwuvko?mw??xc1ze1ldyujz6zysi4?ob??k9lym6w'[int(n,35)%87%52%24-1::23],36)


                                    Try it online!






                                    share|improve this answer











                                    $endgroup$
















                                      7












                                      7








                                      7





                                      $begingroup$


                                      Python 3, score 95, 95 bytes





                                      lambda n:ord("ؙҢ򪀖ਏ𑄗ാᣣ४ঈ挒ឤ?̰ҋ??ۉՉ怮ܞ੊̔"[int(n,35)%87%52%24-1])


                                      Try it online!






                                      Python 3, score 133, 133 bytes





                                      lambda n:int(f'00e0{10**18+10**6}10x1h2411j4?00??811i1207wazxmwuvko?mw??xc1ze1ldyujz6zysi4?ob??k9lym6w'[int(n,35)%87%52%24-1::23],36)


                                      Try it online!






                                      share|improve this answer











                                      $endgroup$




                                      Python 3, score 95, 95 bytes





                                      lambda n:ord("ؙҢ򪀖ਏ𑄗ാᣣ४ঈ挒ឤ?̰ҋ??ۉՉ怮ܞ੊̔"[int(n,35)%87%52%24-1])


                                      Try it online!






                                      Python 3, score 133, 133 bytes





                                      lambda n:int(f'00e0{10**18+10**6}10x1h2411j4?00??811i1207wazxmwuvko?mw??xc1ze1ldyujz6zysi4?ob??k9lym6w'[int(n,35)%87%52%24-1::23],36)


                                      Try it online!







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Dec 5 '18 at 15:58

























                                      answered Dec 5 '18 at 15:50









                                      ovsovs

                                      18.8k21159




                                      18.8k21159























                                          5












                                          $begingroup$

                                          Powershell, 150 bytes, score 163





                                          ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]


                                          Test script:



                                          $f = {
                                          ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]
                                          }

                                          $penalty = @(
                                          ,("Sun" , 696342)
                                          ,("Jupiter" , 69911)
                                          ,("Saturn" , 58232)
                                          ,("Uranus" , 25362)
                                          ,("Neptune" , 24622)
                                          ,("Earth" , 6371)
                                          ,("Venus" , 6052)
                                          ,("Mars" , 3390)
                                          ,("Ganymede" , 2634)
                                          ,("Titan" , 2575)
                                          ,("Mercury" , 2440)
                                          ,("Callisto" , 2410)
                                          ,("Io" , 1822)
                                          ,("Moon" , 1737)
                                          ,("Europa" , 1561)
                                          ,("Triton" , 1353)
                                          ,("Pluto" , 1186)
                                          ,("Eris" , 1163)
                                          ,("Haumea" , 816)
                                          ,("Titania" , 788)
                                          ) | % {
                                          $s,$expected = $_
                                          $result = &$f $s
                                          $ratio = [Math]::Max($result/$expected, $expected/$result)
                                          $ratio*$ratio
                                          }
                                          $scriptLength = $f.ToString().Length - 2 # -4 if CRLF mode
                                          $penaltyMax = ($penalty|Measure-Object -Maximum).Maximum
                                          $score = $scriptLength * $penaltyMax
                                          "$score = $scriptLength * $penaltyMax"


                                          Output:



                                          162.113324228916 = 150 * 1.08075549485944


                                          Explanation:




                                          • Names contain letters only, radiuses contain digits and dots. So we can write all the data in a data string and perform a regexp search.

                                          • The script searches for all substrings from left to right and takes the last result found.

                                          • The input must be title-case to reduce the data string.

                                          • The end of line mode is LF only.


                                          Example:



                                          Titania         Triton         Titan
                                          -------------- ------------- -------------
                                          T -> 1.3 T -> 1.3 T -> 1.3
                                          Ti -> 2.5 Tr -> Ti -> 2.5
                                          Tit -> Tri -> Tit ->
                                          Tita -> Trit -> Tita ->
                                          Titan -> Triton -> Titan ->
                                          Titani -> .8
                                          Titania ->

                                          Result is .8 Result is 1.3 Result is 2.5




                                          Powershell, 178 bytes, score 178



                                          ($args|% t*y|?{'Su696342J69911S58232U25362N24622Ea6371V6052Ma3390G2634Ti2575Me2440C2410I1822M1737Eu1561T1353P1186E1163H816Titani788'-cmatch"$(($y+=$_))(d+)"}|%{+$Matches.1})[-1]





                                          share|improve this answer











                                          $endgroup$


















                                            5












                                            $begingroup$

                                            Powershell, 150 bytes, score 163





                                            ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]


                                            Test script:



                                            $f = {
                                            ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]
                                            }

                                            $penalty = @(
                                            ,("Sun" , 696342)
                                            ,("Jupiter" , 69911)
                                            ,("Saturn" , 58232)
                                            ,("Uranus" , 25362)
                                            ,("Neptune" , 24622)
                                            ,("Earth" , 6371)
                                            ,("Venus" , 6052)
                                            ,("Mars" , 3390)
                                            ,("Ganymede" , 2634)
                                            ,("Titan" , 2575)
                                            ,("Mercury" , 2440)
                                            ,("Callisto" , 2410)
                                            ,("Io" , 1822)
                                            ,("Moon" , 1737)
                                            ,("Europa" , 1561)
                                            ,("Triton" , 1353)
                                            ,("Pluto" , 1186)
                                            ,("Eris" , 1163)
                                            ,("Haumea" , 816)
                                            ,("Titania" , 788)
                                            ) | % {
                                            $s,$expected = $_
                                            $result = &$f $s
                                            $ratio = [Math]::Max($result/$expected, $expected/$result)
                                            $ratio*$ratio
                                            }
                                            $scriptLength = $f.ToString().Length - 2 # -4 if CRLF mode
                                            $penaltyMax = ($penalty|Measure-Object -Maximum).Maximum
                                            $score = $scriptLength * $penaltyMax
                                            "$score = $scriptLength * $penaltyMax"


                                            Output:



                                            162.113324228916 = 150 * 1.08075549485944


                                            Explanation:




                                            • Names contain letters only, radiuses contain digits and dots. So we can write all the data in a data string and perform a regexp search.

                                            • The script searches for all substrings from left to right and takes the last result found.

                                            • The input must be title-case to reduce the data string.

                                            • The end of line mode is LF only.


                                            Example:



                                            Titania         Triton         Titan
                                            -------------- ------------- -------------
                                            T -> 1.3 T -> 1.3 T -> 1.3
                                            Ti -> 2.5 Tr -> Ti -> 2.5
                                            Tit -> Tri -> Tit ->
                                            Tita -> Trit -> Tita ->
                                            Titan -> Triton -> Titan ->
                                            Titani -> .8
                                            Titania ->

                                            Result is .8 Result is 1.3 Result is 2.5




                                            Powershell, 178 bytes, score 178



                                            ($args|% t*y|?{'Su696342J69911S58232U25362N24622Ea6371V6052Ma3390G2634Ti2575Me2440C2410I1822M1737Eu1561T1353P1186E1163H816Titani788'-cmatch"$(($y+=$_))(d+)"}|%{+$Matches.1})[-1]





                                            share|improve this answer











                                            $endgroup$
















                                              5












                                              5








                                              5





                                              $begingroup$

                                              Powershell, 150 bytes, score 163





                                              ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]


                                              Test script:



                                              $f = {
                                              ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]
                                              }

                                              $penalty = @(
                                              ,("Sun" , 696342)
                                              ,("Jupiter" , 69911)
                                              ,("Saturn" , 58232)
                                              ,("Uranus" , 25362)
                                              ,("Neptune" , 24622)
                                              ,("Earth" , 6371)
                                              ,("Venus" , 6052)
                                              ,("Mars" , 3390)
                                              ,("Ganymede" , 2634)
                                              ,("Titan" , 2575)
                                              ,("Mercury" , 2440)
                                              ,("Callisto" , 2410)
                                              ,("Io" , 1822)
                                              ,("Moon" , 1737)
                                              ,("Europa" , 1561)
                                              ,("Triton" , 1353)
                                              ,("Pluto" , 1186)
                                              ,("Eris" , 1163)
                                              ,("Haumea" , 816)
                                              ,("Titania" , 788)
                                              ) | % {
                                              $s,$expected = $_
                                              $result = &$f $s
                                              $ratio = [Math]::Max($result/$expected, $expected/$result)
                                              $ratio*$ratio
                                              }
                                              $scriptLength = $f.ToString().Length - 2 # -4 if CRLF mode
                                              $penaltyMax = ($penalty|Measure-Object -Maximum).Maximum
                                              $score = $scriptLength * $penaltyMax
                                              "$score = $scriptLength * $penaltyMax"


                                              Output:



                                              162.113324228916 = 150 * 1.08075549485944


                                              Explanation:




                                              • Names contain letters only, radiuses contain digits and dots. So we can write all the data in a data string and perform a regexp search.

                                              • The script searches for all substrings from left to right and takes the last result found.

                                              • The input must be title-case to reduce the data string.

                                              • The end of line mode is LF only.


                                              Example:



                                              Titania         Triton         Titan
                                              -------------- ------------- -------------
                                              T -> 1.3 T -> 1.3 T -> 1.3
                                              Ti -> 2.5 Tr -> Ti -> 2.5
                                              Tit -> Tri -> Tit ->
                                              Tita -> Trit -> Tita ->
                                              Titan -> Triton -> Titan ->
                                              Titani -> .8
                                              Titania ->

                                              Result is .8 Result is 1.3 Result is 2.5




                                              Powershell, 178 bytes, score 178



                                              ($args|% t*y|?{'Su696342J69911S58232U25362N24622Ea6371V6052Ma3390G2634Ti2575Me2440C2410I1822M1737Eu1561T1353P1186E1163H816Titani788'-cmatch"$(($y+=$_))(d+)"}|%{+$Matches.1})[-1]





                                              share|improve this answer











                                              $endgroup$



                                              Powershell, 150 bytes, score 163





                                              ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]


                                              Test script:



                                              $f = {
                                              ($args|% t*y|?{'Su680J68S57U25N24Ea6V6Ma3.3G2.6Ti2.5Me2.4C2.4I1.8M1.7Eu1.5T1.3P1.2E1.1H.8Titani.8'-cmatch"$(($y+=$_))([d.]+)"}|%{1kb*$Matches.1})[-1]
                                              }

                                              $penalty = @(
                                              ,("Sun" , 696342)
                                              ,("Jupiter" , 69911)
                                              ,("Saturn" , 58232)
                                              ,("Uranus" , 25362)
                                              ,("Neptune" , 24622)
                                              ,("Earth" , 6371)
                                              ,("Venus" , 6052)
                                              ,("Mars" , 3390)
                                              ,("Ganymede" , 2634)
                                              ,("Titan" , 2575)
                                              ,("Mercury" , 2440)
                                              ,("Callisto" , 2410)
                                              ,("Io" , 1822)
                                              ,("Moon" , 1737)
                                              ,("Europa" , 1561)
                                              ,("Triton" , 1353)
                                              ,("Pluto" , 1186)
                                              ,("Eris" , 1163)
                                              ,("Haumea" , 816)
                                              ,("Titania" , 788)
                                              ) | % {
                                              $s,$expected = $_
                                              $result = &$f $s
                                              $ratio = [Math]::Max($result/$expected, $expected/$result)
                                              $ratio*$ratio
                                              }
                                              $scriptLength = $f.ToString().Length - 2 # -4 if CRLF mode
                                              $penaltyMax = ($penalty|Measure-Object -Maximum).Maximum
                                              $score = $scriptLength * $penaltyMax
                                              "$score = $scriptLength * $penaltyMax"


                                              Output:



                                              162.113324228916 = 150 * 1.08075549485944


                                              Explanation:




                                              • Names contain letters only, radiuses contain digits and dots. So we can write all the data in a data string and perform a regexp search.

                                              • The script searches for all substrings from left to right and takes the last result found.

                                              • The input must be title-case to reduce the data string.

                                              • The end of line mode is LF only.


                                              Example:



                                              Titania         Triton         Titan
                                              -------------- ------------- -------------
                                              T -> 1.3 T -> 1.3 T -> 1.3
                                              Ti -> 2.5 Tr -> Ti -> 2.5
                                              Tit -> Tri -> Tit ->
                                              Tita -> Trit -> Tita ->
                                              Titan -> Triton -> Titan ->
                                              Titani -> .8
                                              Titania ->

                                              Result is .8 Result is 1.3 Result is 2.5




                                              Powershell, 178 bytes, score 178



                                              ($args|% t*y|?{'Su696342J69911S58232U25362N24622Ea6371V6052Ma3390G2634Ti2575Me2440C2410I1822M1737Eu1561T1353P1186E1163H816Titani788'-cmatch"$(($y+=$_))(d+)"}|%{+$Matches.1})[-1]






                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited Dec 6 '18 at 18:44

























                                              answered Dec 6 '18 at 10:05









                                              mazzymazzy

                                              2,3951316




                                              2,3951316























                                                  4












                                                  $begingroup$


                                                  05AB1E, score 100 66 60 (100 61 56 bytes)



                                                  •1∞²îc|I‰∍T‡sÇ3¡ò½в…»Ë•§•1ë£ñƒq£û¿’…•S£y¦¦ÇO96%49%25%èт*


                                                  Port of @OlivierGrégoire's Java answer, so if you like this first answer, make sure to upvote him as well!

                                                  Input in titlecase.



                                                  Verify all test cases.






                                                  05AB1E, score 100 (100 bytes)



                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•§•3«8¹ØмS7Ç•S£.•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•3ôI2£Iθ«kè


                                                  Input in full lowercase. Outputs the exact radius, so no penalty is added.



                                                  Verify all test cases.



                                                  Explanation:





                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•
                                                  # Compressed integer 696342699115823225362246226371605233902634257524402410182217371561135311861163816788
                                                  § # Casted to string (bug, should have been implicitly..)
                                                  •3«8¹ØмS7Ç• # Compressed integer 65555444444444444433
                                                  S # Converted to a list of digits: [6,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3]
                                                  £ # The first integer is split into parts of that size: ["696342","69911","58232","25362","24622","6371","6052","3390","2634","2575","2440","2410","1822","1737","1561","1353","1186","1163","816","788"]
                                                  .•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•
                                                  # Compressed string "sunjursanursneeeahvesmasgaetinmeycaoioomoneuatrnploershaatia"
                                                  3ô # Split into parts of size 3: ["sun","jur","san","urs","nee","eah","ves","mas","gae","tin","mey","cao","ioo","mon","eua","trn","plo","ers","haa","tia"]
                                                  I2£ # The first two characters of the input
                                                  Iθ # The last character of the input
                                                  « # Merged together
                                                  k # Get the index of this string in the list of strings
                                                  è # And use that index to index into the list of integers
                                                  # (and output the result implicitly)


                                                  See this 05AB1E tip of mine (sections How to compress large integers? and How to compress strings not part of the dictionary?) to understand how the compression used works.



                                                  I did create a 70-bytes alternative which would map sun to 600,000; [jupiter,saturn] to 60,000; [uranus,neptune] to 30,000; [earth,venus] to 6,000; [mars,ganymede,titan,mercury,callisto] to 3,000; [io,moon,europa,triton,pluto,eris] to 1,500; and [haumea;titania] to 750. Unfortunately that got a score of 117. I will see if I can get below 100 with an alternative approach later.






                                                  share|improve this answer











                                                  $endgroup$









                                                  • 1




                                                    $begingroup$
                                                    I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
                                                    $endgroup$
                                                    – Olivier Grégoire
                                                    Dec 6 '18 at 10:36










                                                  • $begingroup$
                                                    @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
                                                    $endgroup$
                                                    – Kevin Cruijssen
                                                    Dec 6 '18 at 10:52
















                                                  4












                                                  $begingroup$


                                                  05AB1E, score 100 66 60 (100 61 56 bytes)



                                                  •1∞²îc|I‰∍T‡sÇ3¡ò½в…»Ë•§•1ë£ñƒq£û¿’…•S£y¦¦ÇO96%49%25%èт*


                                                  Port of @OlivierGrégoire's Java answer, so if you like this first answer, make sure to upvote him as well!

                                                  Input in titlecase.



                                                  Verify all test cases.






                                                  05AB1E, score 100 (100 bytes)



                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•§•3«8¹ØмS7Ç•S£.•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•3ôI2£Iθ«kè


                                                  Input in full lowercase. Outputs the exact radius, so no penalty is added.



                                                  Verify all test cases.



                                                  Explanation:





                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•
                                                  # Compressed integer 696342699115823225362246226371605233902634257524402410182217371561135311861163816788
                                                  § # Casted to string (bug, should have been implicitly..)
                                                  •3«8¹ØмS7Ç• # Compressed integer 65555444444444444433
                                                  S # Converted to a list of digits: [6,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3]
                                                  £ # The first integer is split into parts of that size: ["696342","69911","58232","25362","24622","6371","6052","3390","2634","2575","2440","2410","1822","1737","1561","1353","1186","1163","816","788"]
                                                  .•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•
                                                  # Compressed string "sunjursanursneeeahvesmasgaetinmeycaoioomoneuatrnploershaatia"
                                                  3ô # Split into parts of size 3: ["sun","jur","san","urs","nee","eah","ves","mas","gae","tin","mey","cao","ioo","mon","eua","trn","plo","ers","haa","tia"]
                                                  I2£ # The first two characters of the input
                                                  Iθ # The last character of the input
                                                  « # Merged together
                                                  k # Get the index of this string in the list of strings
                                                  è # And use that index to index into the list of integers
                                                  # (and output the result implicitly)


                                                  See this 05AB1E tip of mine (sections How to compress large integers? and How to compress strings not part of the dictionary?) to understand how the compression used works.



                                                  I did create a 70-bytes alternative which would map sun to 600,000; [jupiter,saturn] to 60,000; [uranus,neptune] to 30,000; [earth,venus] to 6,000; [mars,ganymede,titan,mercury,callisto] to 3,000; [io,moon,europa,triton,pluto,eris] to 1,500; and [haumea;titania] to 750. Unfortunately that got a score of 117. I will see if I can get below 100 with an alternative approach later.






                                                  share|improve this answer











                                                  $endgroup$









                                                  • 1




                                                    $begingroup$
                                                    I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
                                                    $endgroup$
                                                    – Olivier Grégoire
                                                    Dec 6 '18 at 10:36










                                                  • $begingroup$
                                                    @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
                                                    $endgroup$
                                                    – Kevin Cruijssen
                                                    Dec 6 '18 at 10:52














                                                  4












                                                  4








                                                  4





                                                  $begingroup$


                                                  05AB1E, score 100 66 60 (100 61 56 bytes)



                                                  •1∞²îc|I‰∍T‡sÇ3¡ò½в…»Ë•§•1ë£ñƒq£û¿’…•S£y¦¦ÇO96%49%25%èт*


                                                  Port of @OlivierGrégoire's Java answer, so if you like this first answer, make sure to upvote him as well!

                                                  Input in titlecase.



                                                  Verify all test cases.






                                                  05AB1E, score 100 (100 bytes)



                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•§•3«8¹ØмS7Ç•S£.•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•3ôI2£Iθ«kè


                                                  Input in full lowercase. Outputs the exact radius, so no penalty is added.



                                                  Verify all test cases.



                                                  Explanation:





                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•
                                                  # Compressed integer 696342699115823225362246226371605233902634257524402410182217371561135311861163816788
                                                  § # Casted to string (bug, should have been implicitly..)
                                                  •3«8¹ØмS7Ç• # Compressed integer 65555444444444444433
                                                  S # Converted to a list of digits: [6,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3]
                                                  £ # The first integer is split into parts of that size: ["696342","69911","58232","25362","24622","6371","6052","3390","2634","2575","2440","2410","1822","1737","1561","1353","1186","1163","816","788"]
                                                  .•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•
                                                  # Compressed string "sunjursanursneeeahvesmasgaetinmeycaoioomoneuatrnploershaatia"
                                                  3ô # Split into parts of size 3: ["sun","jur","san","urs","nee","eah","ves","mas","gae","tin","mey","cao","ioo","mon","eua","trn","plo","ers","haa","tia"]
                                                  I2£ # The first two characters of the input
                                                  Iθ # The last character of the input
                                                  « # Merged together
                                                  k # Get the index of this string in the list of strings
                                                  è # And use that index to index into the list of integers
                                                  # (and output the result implicitly)


                                                  See this 05AB1E tip of mine (sections How to compress large integers? and How to compress strings not part of the dictionary?) to understand how the compression used works.



                                                  I did create a 70-bytes alternative which would map sun to 600,000; [jupiter,saturn] to 60,000; [uranus,neptune] to 30,000; [earth,venus] to 6,000; [mars,ganymede,titan,mercury,callisto] to 3,000; [io,moon,europa,triton,pluto,eris] to 1,500; and [haumea;titania] to 750. Unfortunately that got a score of 117. I will see if I can get below 100 with an alternative approach later.






                                                  share|improve this answer











                                                  $endgroup$




                                                  05AB1E, score 100 66 60 (100 61 56 bytes)



                                                  •1∞²îc|I‰∍T‡sÇ3¡ò½в…»Ë•§•1ë£ñƒq£û¿’…•S£y¦¦ÇO96%49%25%èт*


                                                  Port of @OlivierGrégoire's Java answer, so if you like this first answer, make sure to upvote him as well!

                                                  Input in titlecase.



                                                  Verify all test cases.






                                                  05AB1E, score 100 (100 bytes)



                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•§•3«8¹ØмS7Ç•S£.•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•3ôI2£Iθ«kè


                                                  Input in full lowercase. Outputs the exact radius, so no penalty is added.



                                                  Verify all test cases.



                                                  Explanation:





                                                  •*Òâ%ÌÜS…Ùb‹Úi{e!]ɸ·vÌBUSηHã£āðxyµŠ•
                                                  # Compressed integer 696342699115823225362246226371605233902634257524402410182217371561135311861163816788
                                                  § # Casted to string (bug, should have been implicitly..)
                                                  •3«8¹ØмS7Ç• # Compressed integer 65555444444444444433
                                                  S # Converted to a list of digits: [6,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3]
                                                  £ # The first integer is split into parts of that size: ["696342","69911","58232","25362","24622","6371","6052","3390","2634","2575","2440","2410","1822","1737","1561","1353","1186","1163","816","788"]
                                                  .•WùηƵ@,Sº,ûεβʒóÃX¹Θäáá’Ý)”Ωož∞-z.A±D•
                                                  # Compressed string "sunjursanursneeeahvesmasgaetinmeycaoioomoneuatrnploershaatia"
                                                  3ô # Split into parts of size 3: ["sun","jur","san","urs","nee","eah","ves","mas","gae","tin","mey","cao","ioo","mon","eua","trn","plo","ers","haa","tia"]
                                                  I2£ # The first two characters of the input
                                                  Iθ # The last character of the input
                                                  « # Merged together
                                                  k # Get the index of this string in the list of strings
                                                  è # And use that index to index into the list of integers
                                                  # (and output the result implicitly)


                                                  See this 05AB1E tip of mine (sections How to compress large integers? and How to compress strings not part of the dictionary?) to understand how the compression used works.



                                                  I did create a 70-bytes alternative which would map sun to 600,000; [jupiter,saturn] to 60,000; [uranus,neptune] to 30,000; [earth,venus] to 6,000; [mars,ganymede,titan,mercury,callisto] to 3,000; [io,moon,europa,triton,pluto,eris] to 1,500; and [haumea;titania] to 750. Unfortunately that got a score of 117. I will see if I can get below 100 with an alternative approach later.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Dec 6 '18 at 10:52

























                                                  answered Dec 5 '18 at 15:01









                                                  Kevin CruijssenKevin Cruijssen

                                                  37.5k556195




                                                  37.5k556195








                                                  • 1




                                                    $begingroup$
                                                    I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
                                                    $endgroup$
                                                    – Olivier Grégoire
                                                    Dec 6 '18 at 10:36










                                                  • $begingroup$
                                                    @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
                                                    $endgroup$
                                                    – Kevin Cruijssen
                                                    Dec 6 '18 at 10:52














                                                  • 1




                                                    $begingroup$
                                                    I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
                                                    $endgroup$
                                                    – Olivier Grégoire
                                                    Dec 6 '18 at 10:36










                                                  • $begingroup$
                                                    @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
                                                    $endgroup$
                                                    – Kevin Cruijssen
                                                    Dec 6 '18 at 10:52








                                                  1




                                                  1




                                                  $begingroup$
                                                  I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
                                                  $endgroup$
                                                  – Olivier Grégoire
                                                  Dec 6 '18 at 10:36




                                                  $begingroup$
                                                  I found a better hash that use a 25-chars string instead of a 30-chars one. Check my Java answer if you want to update this answer ;)
                                                  $endgroup$
                                                  – Olivier Grégoire
                                                  Dec 6 '18 at 10:36












                                                  $begingroup$
                                                  @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
                                                  $endgroup$
                                                  – Kevin Cruijssen
                                                  Dec 6 '18 at 10:52




                                                  $begingroup$
                                                  @OlivierGrégoire Thanks for the heads-up. -6 score and -7 bytes. :)
                                                  $endgroup$
                                                  – Kevin Cruijssen
                                                  Dec 6 '18 at 10:52











                                                  4












                                                  $begingroup$

                                                  Mathematica, 57 bytes, score = 62 58



                                                  -4 bytes/score thanks to lirtosiast!



                                                  #&@@WolframAlpha[#<>" size km","Result"]]/._Missing->816&


                                                  Just does a Wolfram Alpha lookup for the mean radius.






                                                  share|improve this answer











                                                  $endgroup$









                                                  • 1




                                                    $begingroup$
                                                    Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 9 '18 at 4:37












                                                  • $begingroup$
                                                    @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 9 '18 at 18:04










                                                  • $begingroup$
                                                    Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 10 '18 at 1:10












                                                  • $begingroup$
                                                    @ASCII-only If you're worried, you can always post a question on Meta.
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 10 '18 at 2:05










                                                  • $begingroup$
                                                    @leg In that case the data can be used offline after downloading. In this case, it's not.
                                                    $endgroup$
                                                    – user202729
                                                    Dec 11 '18 at 5:50
















                                                  4












                                                  $begingroup$

                                                  Mathematica, 57 bytes, score = 62 58



                                                  -4 bytes/score thanks to lirtosiast!



                                                  #&@@WolframAlpha[#<>" size km","Result"]]/._Missing->816&


                                                  Just does a Wolfram Alpha lookup for the mean radius.






                                                  share|improve this answer











                                                  $endgroup$









                                                  • 1




                                                    $begingroup$
                                                    Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 9 '18 at 4:37












                                                  • $begingroup$
                                                    @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 9 '18 at 18:04










                                                  • $begingroup$
                                                    Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 10 '18 at 1:10












                                                  • $begingroup$
                                                    @ASCII-only If you're worried, you can always post a question on Meta.
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 10 '18 at 2:05










                                                  • $begingroup$
                                                    @leg In that case the data can be used offline after downloading. In this case, it's not.
                                                    $endgroup$
                                                    – user202729
                                                    Dec 11 '18 at 5:50














                                                  4












                                                  4








                                                  4





                                                  $begingroup$

                                                  Mathematica, 57 bytes, score = 62 58



                                                  -4 bytes/score thanks to lirtosiast!



                                                  #&@@WolframAlpha[#<>" size km","Result"]]/._Missing->816&


                                                  Just does a Wolfram Alpha lookup for the mean radius.






                                                  share|improve this answer











                                                  $endgroup$



                                                  Mathematica, 57 bytes, score = 62 58



                                                  -4 bytes/score thanks to lirtosiast!



                                                  #&@@WolframAlpha[#<>" size km","Result"]]/._Missing->816&


                                                  Just does a Wolfram Alpha lookup for the mean radius.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Dec 6 '18 at 12:11

























                                                  answered Dec 6 '18 at 2:59









                                                  LegionMammal978LegionMammal978

                                                  15.2k41852




                                                  15.2k41852








                                                  • 1




                                                    $begingroup$
                                                    Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 9 '18 at 4:37












                                                  • $begingroup$
                                                    @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 9 '18 at 18:04










                                                  • $begingroup$
                                                    Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 10 '18 at 1:10












                                                  • $begingroup$
                                                    @ASCII-only If you're worried, you can always post a question on Meta.
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 10 '18 at 2:05










                                                  • $begingroup$
                                                    @leg In that case the data can be used offline after downloading. In this case, it's not.
                                                    $endgroup$
                                                    – user202729
                                                    Dec 11 '18 at 5:50














                                                  • 1




                                                    $begingroup$
                                                    Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 9 '18 at 4:37












                                                  • $begingroup$
                                                    @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 9 '18 at 18:04










                                                  • $begingroup$
                                                    Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
                                                    $endgroup$
                                                    – ASCII-only
                                                    Dec 10 '18 at 1:10












                                                  • $begingroup$
                                                    @ASCII-only If you're worried, you can always post a question on Meta.
                                                    $endgroup$
                                                    – LegionMammal978
                                                    Dec 10 '18 at 2:05










                                                  • $begingroup$
                                                    @leg In that case the data can be used offline after downloading. In this case, it's not.
                                                    $endgroup$
                                                    – user202729
                                                    Dec 11 '18 at 5:50








                                                  1




                                                  1




                                                  $begingroup$
                                                  Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
                                                  $endgroup$
                                                  – ASCII-only
                                                  Dec 9 '18 at 4:37






                                                  $begingroup$
                                                  Hmm. Doesn't this count as using the internet? Unless Mathematica actually does contain the entire WolframAlpha engine
                                                  $endgroup$
                                                  – ASCII-only
                                                  Dec 9 '18 at 4:37














                                                  $begingroup$
                                                  @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
                                                  $endgroup$
                                                  – LegionMammal978
                                                  Dec 9 '18 at 18:04




                                                  $begingroup$
                                                  @ASCII-only I mean, Mathematica's datasets are allowed, and the WolframAlpha function has been used at least four times...
                                                  $endgroup$
                                                  – LegionMammal978
                                                  Dec 9 '18 at 18:04












                                                  $begingroup$
                                                  Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
                                                  $endgroup$
                                                  – ASCII-only
                                                  Dec 10 '18 at 1:10






                                                  $begingroup$
                                                  Hmm. Seems kinda like an arbitrary decision, what's stopping other languages from adding search engine functions? IMO datasets are a bit different - downloading all of them is just so massive that a central server gives it to you when needed
                                                  $endgroup$
                                                  – ASCII-only
                                                  Dec 10 '18 at 1:10














                                                  $begingroup$
                                                  @ASCII-only If you're worried, you can always post a question on Meta.
                                                  $endgroup$
                                                  – LegionMammal978
                                                  Dec 10 '18 at 2:05




                                                  $begingroup$
                                                  @ASCII-only If you're worried, you can always post a question on Meta.
                                                  $endgroup$
                                                  – LegionMammal978
                                                  Dec 10 '18 at 2:05












                                                  $begingroup$
                                                  @leg In that case the data can be used offline after downloading. In this case, it's not.
                                                  $endgroup$
                                                  – user202729
                                                  Dec 11 '18 at 5:50




                                                  $begingroup$
                                                  @leg In that case the data can be used offline after downloading. In this case, it's not.
                                                  $endgroup$
                                                  – user202729
                                                  Dec 11 '18 at 5:50











                                                  4












                                                  $begingroup$


                                                  Jelly, 28 bytes, score = 31



                                                  “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ1.1*


                                                  This uses a configurable hashing built-in that I added to Jelly at @lirtosiast's suggestion.



                                                  Input is in titlecase, output is the power of 1.1 with the least error.



                                                  Try it online!



                                                  How it works



                                                  This answer consists of merely two parts.




                                                  • First, “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ uses the new built-in to map each of the 20 possible inputs to 15 different integers.

                                                  • Then, 1.1* elevates 1.1 to the computed power.


                                                  “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ is a literal; every non-quote character is replaced by it's 0-based index in Jelly's code page, yielding $[95, 95, 169, 55, 242], [82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$.



                                                  The hashing built-in first maps $[95, 95, 169, 55, 242]$ to an integer by incrementing each number, then treating the result as the bijective base-250 digits integer and adding $1$. This yields $376510639244$.



                                                  By halving and flooring this integer until the result is $0$, we get the sequence $[376510639244, 188255319622, 94127659811, 47063829905, dots, 5, 2, 1, 0]$, which has the forward differences $[188255319622, 94127659811, 47063829906, dots, 3, 1, 1]$.



                                                  Next, we generate 64 64-bit integers by applying SHAKE256-4096 to the string representation of the internal representation of 's right argument, then chopping the resulting 4096 bits into 64 64-bit chunks.



                                                  now computes the dot product of the 39 differences and the first 39 generated 64-bit integers, modulo $2^{64}$. This yields an integer in $[0, 2^{64})$.



                                                  The list $[82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$ has length 15, so we multiply the generated integer by 15 and take the 64 higher bits of the result. This yields an integer in $[0, 15)$, which we use to index into the list.



                                                  To find the appropriate hash configuration, I've used a brute-forcer in C that is part of the Jelly repo.






                                                  share|improve this answer









                                                  $endgroup$


















                                                    4












                                                    $begingroup$


                                                    Jelly, 28 bytes, score = 31



                                                    “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ1.1*


                                                    This uses a configurable hashing built-in that I added to Jelly at @lirtosiast's suggestion.



                                                    Input is in titlecase, output is the power of 1.1 with the least error.



                                                    Try it online!



                                                    How it works



                                                    This answer consists of merely two parts.




                                                    • First, “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ uses the new built-in to map each of the 20 possible inputs to 15 different integers.

                                                    • Then, 1.1* elevates 1.1 to the computed power.


                                                    “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ is a literal; every non-quote character is replaced by it's 0-based index in Jelly's code page, yielding $[95, 95, 169, 55, 242], [82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$.



                                                    The hashing built-in first maps $[95, 95, 169, 55, 242]$ to an integer by incrementing each number, then treating the result as the bijective base-250 digits integer and adding $1$. This yields $376510639244$.



                                                    By halving and flooring this integer until the result is $0$, we get the sequence $[376510639244, 188255319622, 94127659811, 47063829905, dots, 5, 2, 1, 0]$, which has the forward differences $[188255319622, 94127659811, 47063829906, dots, 3, 1, 1]$.



                                                    Next, we generate 64 64-bit integers by applying SHAKE256-4096 to the string representation of the internal representation of 's right argument, then chopping the resulting 4096 bits into 64 64-bit chunks.



                                                    now computes the dot product of the 39 differences and the first 39 generated 64-bit integers, modulo $2^{64}$. This yields an integer in $[0, 2^{64})$.



                                                    The list $[82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$ has length 15, so we multiply the generated integer by 15 and take the 64 higher bits of the result. This yields an integer in $[0, 15)$, which we use to index into the list.



                                                    To find the appropriate hash configuration, I've used a brute-forcer in C that is part of the Jelly repo.






                                                    share|improve this answer









                                                    $endgroup$
















                                                      4












                                                      4








                                                      4





                                                      $begingroup$


                                                      Jelly, 28 bytes, score = 31



                                                      “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ1.1*


                                                      This uses a configurable hashing built-in that I added to Jelly at @lirtosiast's suggestion.



                                                      Input is in titlecase, output is the power of 1.1 with the least error.



                                                      Try it online!



                                                      How it works



                                                      This answer consists of merely two parts.




                                                      • First, “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ uses the new built-in to map each of the 20 possible inputs to 15 different integers.

                                                      • Then, 1.1* elevates 1.1 to the computed power.


                                                      “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ is a literal; every non-quote character is replaced by it's 0-based index in Jelly's code page, yielding $[95, 95, 169, 55, 242], [82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$.



                                                      The hashing built-in first maps $[95, 95, 169, 55, 242]$ to an integer by incrementing each number, then treating the result as the bijective base-250 digits integer and adding $1$. This yields $376510639244$.



                                                      By halving and flooring this integer until the result is $0$, we get the sequence $[376510639244, 188255319622, 94127659811, 47063829905, dots, 5, 2, 1, 0]$, which has the forward differences $[188255319622, 94127659811, 47063829906, dots, 3, 1, 1]$.



                                                      Next, we generate 64 64-bit integers by applying SHAKE256-4096 to the string representation of the internal representation of 's right argument, then chopping the resulting 4096 bits into 64 64-bit chunks.



                                                      now computes the dot product of the 39 differences and the first 39 generated 64-bit integers, modulo $2^{64}$. This yields an integer in $[0, 2^{64})$.



                                                      The list $[82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$ has length 15, so we multiply the generated integer by 15 and take the 64 higher bits of the result. This yields an integer in $[0, 15)$, which we use to index into the list.



                                                      To find the appropriate hash configuration, I've used a brute-forcer in C that is part of the Jelly repo.






                                                      share|improve this answer









                                                      $endgroup$




                                                      Jelly, 28 bytes, score = 31



                                                      “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ1.1*


                                                      This uses a configurable hashing built-in that I added to Jelly at @lirtosiast's suggestion.



                                                      Input is in titlecase, output is the power of 1.1 with the least error.



                                                      Try it online!



                                                      How it works



                                                      This answer consists of merely two parts.




                                                      • First, “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ḥ uses the new built-in to map each of the 20 possible inputs to 15 different integers.

                                                      • Then, 1.1* elevates 1.1 to the computed power.


                                                      “__ʋ7ṗ“RUu⁽NMsOSJj[FL‘ is a literal; every non-quote character is replaced by it's 0-based index in Jelly's code page, yielding $[95, 95, 169, 55, 242], [82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$.



                                                      The hashing built-in first maps $[95, 95, 169, 55, 242]$ to an integer by incrementing each number, then treating the result as the bijective base-250 digits integer and adding $1$. This yields $376510639244$.



                                                      By halving and flooring this integer until the result is $0$, we get the sequence $[376510639244, 188255319622, 94127659811, 47063829905, dots, 5, 2, 1, 0]$, which has the forward differences $[188255319622, 94127659811, 47063829906, dots, 3, 1, 1]$.



                                                      Next, we generate 64 64-bit integers by applying SHAKE256-4096 to the string representation of the internal representation of 's right argument, then chopping the resulting 4096 bits into 64 64-bit chunks.



                                                      now computes the dot product of the 39 differences and the first 39 generated 64-bit integers, modulo $2^{64}$. This yields an integer in $[0, 2^{64})$.



                                                      The list $[82, 85, 117, 141, 78, 77, 92, 115, 79, 83, 74, 106, 91, 70, 76]$ has length 15, so we multiply the generated integer by 15 and take the 64 higher bits of the result. This yields an integer in $[0, 15)$, which we use to index into the list.



                                                      To find the appropriate hash configuration, I've used a brute-forcer in C that is part of the Jelly repo.







                                                      share|improve this answer












                                                      share|improve this answer



                                                      share|improve this answer










                                                      answered Dec 11 '18 at 21:07









                                                      DennisDennis

                                                      188k32299738




                                                      188k32299738























                                                          3












                                                          $begingroup$


                                                          Python 2, 155 bytes, score = 155





                                                          lambda p:int('G11KK54222111111XXNM8MCO37WQ53YXHE93V8BIF2IMH1WU9KPU2MLN    HGR'['uSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])/2::20],35)


                                                          Try it online!



                                                          Surprisingly well for this lazy solution... will look into improving as well. ;-)






                                                          share|improve this answer











                                                          $endgroup$


















                                                            3












                                                            $begingroup$


                                                            Python 2, 155 bytes, score = 155





                                                            lambda p:int('G11KK54222111111XXNM8MCO37WQ53YXHE93V8BIF2IMH1WU9KPU2MLN    HGR'['uSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])/2::20],35)


                                                            Try it online!



                                                            Surprisingly well for this lazy solution... will look into improving as well. ;-)






                                                            share|improve this answer











                                                            $endgroup$
















                                                              3












                                                              3








                                                              3





                                                              $begingroup$


                                                              Python 2, 155 bytes, score = 155





                                                              lambda p:int('G11KK54222111111XXNM8MCO37WQ53YXHE93V8BIF2IMH1WU9KPU2MLN    HGR'['uSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])/2::20],35)


                                                              Try it online!



                                                              Surprisingly well for this lazy solution... will look into improving as well. ;-)






                                                              share|improve this answer











                                                              $endgroup$




                                                              Python 2, 155 bytes, score = 155





                                                              lambda p:int('G11KK54222111111XXNM8MCO37WQ53YXHE93V8BIF2IMH1WU9KPU2MLN    HGR'['uSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])/2::20],35)


                                                              Try it online!



                                                              Surprisingly well for this lazy solution... will look into improving as well. ;-)







                                                              share|improve this answer














                                                              share|improve this answer



                                                              share|improve this answer








                                                              edited Dec 5 '18 at 15:55

























                                                              answered Dec 5 '18 at 15:48









                                                              Erik the OutgolferErik the Outgolfer

                                                              31.8k429103




                                                              31.8k429103























                                                                  3












                                                                  $begingroup$


                                                                  Japt, 86 bytes, score = 94



                                                                  g5 ¥'i?788:[7*A³7*L6*LG²G²IIÉHÄDÑDÑCÑCÑGÄÄGÄGECC8]g`suj«a¨Ì¼và@ã/eÖô¶e©rp¤r`bU¯2)z)*L


                                                                  Try it for all inputs, Calculate the score, or Check the highest error



                                                                  Very similar to Olivier's original answer. Input is all lowercase.



                                                                  After various improvements to the output values, the current highest error is Venus at just over 4%.



                                                                  Explanation now that things are a bit more stable:



                                                                  ¤¥`Éa`?                             :If the fifth character of the input is 'i':
                                                                  788 : Output 788.
                                                                  : :Otherwise:
                                                                  [...] : From the array representing radii
                                                                  g : Get the value at the index:
                                                                  `...` : In the string representing names
                                                                  b : Find the first index where this string appears:
                                                                  U¯2) : The first two characters of the input
                                                                  z) : And divide it by two
                                                                  *L : Multiply that value by 100


                                                                  The string for the names is sujusaurneeavemagatimecaiomoeutrplerha compressed using Japt's built-in compression. The numbers representing the radii are calculated like so:



                                                                                            My value | Actual value
                                                                  ---------+-------------
                                                                  7 * 10 ^ 3 = 7000 * 100 = 700000 | 696342
                                                                  7 * 100 = 700 * 100 = 70000 | 69911
                                                                  6 * 100 = 600 * 100 = 60000 | 58232
                                                                  16 * 16 = 256 * 100 = 25600 | 25362
                                                                  16 * 16 = 256 * 100 = 25600 | 24622
                                                                  64 = 64 * 100 = 6400 | 6371
                                                                  64 - 1 = 63 * 100 = 6300 | 6052
                                                                  32 + 1 = 33 * 100 = 3300 | 3390
                                                                  13 * 2 = 26 * 100 = 2600 | 2634
                                                                  13 * 2 = 26 * 100 = 2600 | 2575
                                                                  12 * 2 = 24 * 100 = 2400 | 2440
                                                                  12 * 2 = 24 * 100 = 2400 | 2410
                                                                  16 + 1 + 1 = 18 * 100 = 1800 | 1822
                                                                  16 + 1 = 17 * 100 = 1700 | 1737
                                                                  16 = 16 * 100 = 1600 | 1561
                                                                  14 = 14 * 100 = 1400 | 1353
                                                                  12 = 12 * 100 = 1200 | 1186
                                                                  12 = 12 * 100 = 1200 | 1163
                                                                  8 = 8 * 100 = 800 | 816
                                                                  788 = 788 | 788





                                                                  share|improve this answer











                                                                  $endgroup$


















                                                                    3












                                                                    $begingroup$


                                                                    Japt, 86 bytes, score = 94



                                                                    g5 ¥'i?788:[7*A³7*L6*LG²G²IIÉHÄDÑDÑCÑCÑGÄÄGÄGECC8]g`suj«a¨Ì¼và@ã/eÖô¶e©rp¤r`bU¯2)z)*L


                                                                    Try it for all inputs, Calculate the score, or Check the highest error



                                                                    Very similar to Olivier's original answer. Input is all lowercase.



                                                                    After various improvements to the output values, the current highest error is Venus at just over 4%.



                                                                    Explanation now that things are a bit more stable:



                                                                    ¤¥`Éa`?                             :If the fifth character of the input is 'i':
                                                                    788 : Output 788.
                                                                    : :Otherwise:
                                                                    [...] : From the array representing radii
                                                                    g : Get the value at the index:
                                                                    `...` : In the string representing names
                                                                    b : Find the first index where this string appears:
                                                                    U¯2) : The first two characters of the input
                                                                    z) : And divide it by two
                                                                    *L : Multiply that value by 100


                                                                    The string for the names is sujusaurneeavemagatimecaiomoeutrplerha compressed using Japt's built-in compression. The numbers representing the radii are calculated like so:



                                                                                              My value | Actual value
                                                                    ---------+-------------
                                                                    7 * 10 ^ 3 = 7000 * 100 = 700000 | 696342
                                                                    7 * 100 = 700 * 100 = 70000 | 69911
                                                                    6 * 100 = 600 * 100 = 60000 | 58232
                                                                    16 * 16 = 256 * 100 = 25600 | 25362
                                                                    16 * 16 = 256 * 100 = 25600 | 24622
                                                                    64 = 64 * 100 = 6400 | 6371
                                                                    64 - 1 = 63 * 100 = 6300 | 6052
                                                                    32 + 1 = 33 * 100 = 3300 | 3390
                                                                    13 * 2 = 26 * 100 = 2600 | 2634
                                                                    13 * 2 = 26 * 100 = 2600 | 2575
                                                                    12 * 2 = 24 * 100 = 2400 | 2440
                                                                    12 * 2 = 24 * 100 = 2400 | 2410
                                                                    16 + 1 + 1 = 18 * 100 = 1800 | 1822
                                                                    16 + 1 = 17 * 100 = 1700 | 1737
                                                                    16 = 16 * 100 = 1600 | 1561
                                                                    14 = 14 * 100 = 1400 | 1353
                                                                    12 = 12 * 100 = 1200 | 1186
                                                                    12 = 12 * 100 = 1200 | 1163
                                                                    8 = 8 * 100 = 800 | 816
                                                                    788 = 788 | 788





                                                                    share|improve this answer











                                                                    $endgroup$
















                                                                      3












                                                                      3








                                                                      3





                                                                      $begingroup$


                                                                      Japt, 86 bytes, score = 94



                                                                      g5 ¥'i?788:[7*A³7*L6*LG²G²IIÉHÄDÑDÑCÑCÑGÄÄGÄGECC8]g`suj«a¨Ì¼và@ã/eÖô¶e©rp¤r`bU¯2)z)*L


                                                                      Try it for all inputs, Calculate the score, or Check the highest error



                                                                      Very similar to Olivier's original answer. Input is all lowercase.



                                                                      After various improvements to the output values, the current highest error is Venus at just over 4%.



                                                                      Explanation now that things are a bit more stable:



                                                                      ¤¥`Éa`?                             :If the fifth character of the input is 'i':
                                                                      788 : Output 788.
                                                                      : :Otherwise:
                                                                      [...] : From the array representing radii
                                                                      g : Get the value at the index:
                                                                      `...` : In the string representing names
                                                                      b : Find the first index where this string appears:
                                                                      U¯2) : The first two characters of the input
                                                                      z) : And divide it by two
                                                                      *L : Multiply that value by 100


                                                                      The string for the names is sujusaurneeavemagatimecaiomoeutrplerha compressed using Japt's built-in compression. The numbers representing the radii are calculated like so:



                                                                                                My value | Actual value
                                                                      ---------+-------------
                                                                      7 * 10 ^ 3 = 7000 * 100 = 700000 | 696342
                                                                      7 * 100 = 700 * 100 = 70000 | 69911
                                                                      6 * 100 = 600 * 100 = 60000 | 58232
                                                                      16 * 16 = 256 * 100 = 25600 | 25362
                                                                      16 * 16 = 256 * 100 = 25600 | 24622
                                                                      64 = 64 * 100 = 6400 | 6371
                                                                      64 - 1 = 63 * 100 = 6300 | 6052
                                                                      32 + 1 = 33 * 100 = 3300 | 3390
                                                                      13 * 2 = 26 * 100 = 2600 | 2634
                                                                      13 * 2 = 26 * 100 = 2600 | 2575
                                                                      12 * 2 = 24 * 100 = 2400 | 2440
                                                                      12 * 2 = 24 * 100 = 2400 | 2410
                                                                      16 + 1 + 1 = 18 * 100 = 1800 | 1822
                                                                      16 + 1 = 17 * 100 = 1700 | 1737
                                                                      16 = 16 * 100 = 1600 | 1561
                                                                      14 = 14 * 100 = 1400 | 1353
                                                                      12 = 12 * 100 = 1200 | 1186
                                                                      12 = 12 * 100 = 1200 | 1163
                                                                      8 = 8 * 100 = 800 | 816
                                                                      788 = 788 | 788





                                                                      share|improve this answer











                                                                      $endgroup$




                                                                      Japt, 86 bytes, score = 94



                                                                      g5 ¥'i?788:[7*A³7*L6*LG²G²IIÉHÄDÑDÑCÑCÑGÄÄGÄGECC8]g`suj«a¨Ì¼và@ã/eÖô¶e©rp¤r`bU¯2)z)*L


                                                                      Try it for all inputs, Calculate the score, or Check the highest error



                                                                      Very similar to Olivier's original answer. Input is all lowercase.



                                                                      After various improvements to the output values, the current highest error is Venus at just over 4%.



                                                                      Explanation now that things are a bit more stable:



                                                                      ¤¥`Éa`?                             :If the fifth character of the input is 'i':
                                                                      788 : Output 788.
                                                                      : :Otherwise:
                                                                      [...] : From the array representing radii
                                                                      g : Get the value at the index:
                                                                      `...` : In the string representing names
                                                                      b : Find the first index where this string appears:
                                                                      U¯2) : The first two characters of the input
                                                                      z) : And divide it by two
                                                                      *L : Multiply that value by 100


                                                                      The string for the names is sujusaurneeavemagatimecaiomoeutrplerha compressed using Japt's built-in compression. The numbers representing the radii are calculated like so:



                                                                                                My value | Actual value
                                                                      ---------+-------------
                                                                      7 * 10 ^ 3 = 7000 * 100 = 700000 | 696342
                                                                      7 * 100 = 700 * 100 = 70000 | 69911
                                                                      6 * 100 = 600 * 100 = 60000 | 58232
                                                                      16 * 16 = 256 * 100 = 25600 | 25362
                                                                      16 * 16 = 256 * 100 = 25600 | 24622
                                                                      64 = 64 * 100 = 6400 | 6371
                                                                      64 - 1 = 63 * 100 = 6300 | 6052
                                                                      32 + 1 = 33 * 100 = 3300 | 3390
                                                                      13 * 2 = 26 * 100 = 2600 | 2634
                                                                      13 * 2 = 26 * 100 = 2600 | 2575
                                                                      12 * 2 = 24 * 100 = 2400 | 2440
                                                                      12 * 2 = 24 * 100 = 2400 | 2410
                                                                      16 + 1 + 1 = 18 * 100 = 1800 | 1822
                                                                      16 + 1 = 17 * 100 = 1700 | 1737
                                                                      16 = 16 * 100 = 1600 | 1561
                                                                      14 = 14 * 100 = 1400 | 1353
                                                                      12 = 12 * 100 = 1200 | 1186
                                                                      12 = 12 * 100 = 1200 | 1163
                                                                      8 = 8 * 100 = 800 | 816
                                                                      788 = 788 | 788






                                                                      share|improve this answer














                                                                      share|improve this answer



                                                                      share|improve this answer








                                                                      edited Dec 5 '18 at 22:13

























                                                                      answered Dec 5 '18 at 17:06









                                                                      Kamil DrakariKamil Drakari

                                                                      3,241416




                                                                      3,241416























                                                                          3












                                                                          $begingroup$

                                                                          Japt, 77 76 75 bytes, score = 75



                                                                          First pass at this; I wanted to try a 0 penalty solution to give myself a baseline to work off. Will come back to it tomorrow to see what improvements can be made, hopefully still for 0 penalty.



                                                                          Input is case-insensitive.



                                                                          n35 %87%52 g"..."ò)mc


                                                                          Try it or test all inputs



                                                                          The "..." represents a string containing many unprintables. The codepoints are:



                                                                          32,32,15,61,11,86,696,342,25,75,699,11,33,90,63,71,24,10,24,40,253,62,60,52,32,32,8,16,11,63,32,32,32,32,58,232,17,37,135,3,246,22,18,22,26,34,7,88


                                                                          To offer a quick explanation: the string gets split into chunks of 2 characters. We then index into that array using part of ovs' formula plus some index-wrapping and then map the 2 characters to their codepoints.




                                                                          • Saved a byte/point thanks to ETH


                                                                          54 bytes, score = 58



                                                                          A port of Olivier's solution.



                                                                          "ýCĄ (ᬺ!˂Fɍ"cU¤¬xc %96%49)-7 *L


                                                                          Test all inputs






                                                                          share|improve this answer











                                                                          $endgroup$













                                                                          • $begingroup$
                                                                            I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 4:14










                                                                          • $begingroup$
                                                                            @ETHproductions, that doesn't seem to work
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 12:41










                                                                          • $begingroup$
                                                                            Here's what I was thinking
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 14:50










                                                                          • $begingroup$
                                                                            @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 15:03
















                                                                          3












                                                                          $begingroup$

                                                                          Japt, 77 76 75 bytes, score = 75



                                                                          First pass at this; I wanted to try a 0 penalty solution to give myself a baseline to work off. Will come back to it tomorrow to see what improvements can be made, hopefully still for 0 penalty.



                                                                          Input is case-insensitive.



                                                                          n35 %87%52 g"..."ò)mc


                                                                          Try it or test all inputs



                                                                          The "..." represents a string containing many unprintables. The codepoints are:



                                                                          32,32,15,61,11,86,696,342,25,75,699,11,33,90,63,71,24,10,24,40,253,62,60,52,32,32,8,16,11,63,32,32,32,32,58,232,17,37,135,3,246,22,18,22,26,34,7,88


                                                                          To offer a quick explanation: the string gets split into chunks of 2 characters. We then index into that array using part of ovs' formula plus some index-wrapping and then map the 2 characters to their codepoints.




                                                                          • Saved a byte/point thanks to ETH


                                                                          54 bytes, score = 58



                                                                          A port of Olivier's solution.



                                                                          "ýCĄ (ᬺ!˂Fɍ"cU¤¬xc %96%49)-7 *L


                                                                          Test all inputs






                                                                          share|improve this answer











                                                                          $endgroup$













                                                                          • $begingroup$
                                                                            I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 4:14










                                                                          • $begingroup$
                                                                            @ETHproductions, that doesn't seem to work
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 12:41










                                                                          • $begingroup$
                                                                            Here's what I was thinking
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 14:50










                                                                          • $begingroup$
                                                                            @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 15:03














                                                                          3












                                                                          3








                                                                          3





                                                                          $begingroup$

                                                                          Japt, 77 76 75 bytes, score = 75



                                                                          First pass at this; I wanted to try a 0 penalty solution to give myself a baseline to work off. Will come back to it tomorrow to see what improvements can be made, hopefully still for 0 penalty.



                                                                          Input is case-insensitive.



                                                                          n35 %87%52 g"..."ò)mc


                                                                          Try it or test all inputs



                                                                          The "..." represents a string containing many unprintables. The codepoints are:



                                                                          32,32,15,61,11,86,696,342,25,75,699,11,33,90,63,71,24,10,24,40,253,62,60,52,32,32,8,16,11,63,32,32,32,32,58,232,17,37,135,3,246,22,18,22,26,34,7,88


                                                                          To offer a quick explanation: the string gets split into chunks of 2 characters. We then index into that array using part of ovs' formula plus some index-wrapping and then map the 2 characters to their codepoints.




                                                                          • Saved a byte/point thanks to ETH


                                                                          54 bytes, score = 58



                                                                          A port of Olivier's solution.



                                                                          "ýCĄ (ᬺ!˂Fɍ"cU¤¬xc %96%49)-7 *L


                                                                          Test all inputs






                                                                          share|improve this answer











                                                                          $endgroup$



                                                                          Japt, 77 76 75 bytes, score = 75



                                                                          First pass at this; I wanted to try a 0 penalty solution to give myself a baseline to work off. Will come back to it tomorrow to see what improvements can be made, hopefully still for 0 penalty.



                                                                          Input is case-insensitive.



                                                                          n35 %87%52 g"..."ò)mc


                                                                          Try it or test all inputs



                                                                          The "..." represents a string containing many unprintables. The codepoints are:



                                                                          32,32,15,61,11,86,696,342,25,75,699,11,33,90,63,71,24,10,24,40,253,62,60,52,32,32,8,16,11,63,32,32,32,32,58,232,17,37,135,3,246,22,18,22,26,34,7,88


                                                                          To offer a quick explanation: the string gets split into chunks of 2 characters. We then index into that array using part of ovs' formula plus some index-wrapping and then map the 2 characters to their codepoints.




                                                                          • Saved a byte/point thanks to ETH


                                                                          54 bytes, score = 58



                                                                          A port of Olivier's solution.



                                                                          "ýCĄ (ᬺ!˂Fɍ"cU¤¬xc %96%49)-7 *L


                                                                          Test all inputs







                                                                          share|improve this answer














                                                                          share|improve this answer



                                                                          share|improve this answer








                                                                          edited Dec 6 '18 at 15:08

























                                                                          answered Dec 5 '18 at 22:46









                                                                          ShaggyShaggy

                                                                          19.6k21666




                                                                          19.6k21666












                                                                          • $begingroup$
                                                                            I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 4:14










                                                                          • $begingroup$
                                                                            @ETHproductions, that doesn't seem to work
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 12:41










                                                                          • $begingroup$
                                                                            Here's what I was thinking
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 14:50










                                                                          • $begingroup$
                                                                            @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 15:03


















                                                                          • $begingroup$
                                                                            I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 4:14










                                                                          • $begingroup$
                                                                            @ETHproductions, that doesn't seem to work
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 12:41










                                                                          • $begingroup$
                                                                            Here's what I was thinking
                                                                            $endgroup$
                                                                            – ETHproductions
                                                                            Dec 6 '18 at 14:50










                                                                          • $begingroup$
                                                                            @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                                                                            $endgroup$
                                                                            – Shaggy
                                                                            Dec 6 '18 at 15:03
















                                                                          $begingroup$
                                                                          I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                                                                          $endgroup$
                                                                          – ETHproductions
                                                                          Dec 6 '18 at 4:14




                                                                          $begingroup$
                                                                          I think you can save a byte by moving the first entry (#23) to the end where it belongs, and removing the %24 :-)
                                                                          $endgroup$
                                                                          – ETHproductions
                                                                          Dec 6 '18 at 4:14












                                                                          $begingroup$
                                                                          @ETHproductions, that doesn't seem to work
                                                                          $endgroup$
                                                                          – Shaggy
                                                                          Dec 6 '18 at 12:41




                                                                          $begingroup$
                                                                          @ETHproductions, that doesn't seem to work
                                                                          $endgroup$
                                                                          – Shaggy
                                                                          Dec 6 '18 at 12:41












                                                                          $begingroup$
                                                                          Here's what I was thinking
                                                                          $endgroup$
                                                                          – ETHproductions
                                                                          Dec 6 '18 at 14:50




                                                                          $begingroup$
                                                                          Here's what I was thinking
                                                                          $endgroup$
                                                                          – ETHproductions
                                                                          Dec 6 '18 at 14:50












                                                                          $begingroup$
                                                                          @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                                                                          $endgroup$
                                                                          – Shaggy
                                                                          Dec 6 '18 at 15:03




                                                                          $begingroup$
                                                                          @ETHproductions: Ah, yes, just twigged myself that I'd need to add a placeholder element to the start of the array. Thanks.
                                                                          $endgroup$
                                                                          – Shaggy
                                                                          Dec 6 '18 at 15:03











                                                                          2












                                                                          $begingroup$


                                                                          PowerShell, 203 bytes, score 203





                                                                          param($a)if($a-eq'Titan'){2575;exit}(696342,69911,58232,25362,24622,6371,6052,3390,2634,2440,2410,1822,1737,1561,1353,1186,1163,816,788)["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".indexOf(-join$a[0..1])/2]


                                                                          Try it online!



                                                                          Very similar to Olivier's answer, now that I see it, but developed independently.






                                                                          share|improve this answer









                                                                          $endgroup$


















                                                                            2












                                                                            $begingroup$


                                                                            PowerShell, 203 bytes, score 203





                                                                            param($a)if($a-eq'Titan'){2575;exit}(696342,69911,58232,25362,24622,6371,6052,3390,2634,2440,2410,1822,1737,1561,1353,1186,1163,816,788)["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".indexOf(-join$a[0..1])/2]


                                                                            Try it online!



                                                                            Very similar to Olivier's answer, now that I see it, but developed independently.






                                                                            share|improve this answer









                                                                            $endgroup$
















                                                                              2












                                                                              2








                                                                              2





                                                                              $begingroup$


                                                                              PowerShell, 203 bytes, score 203





                                                                              param($a)if($a-eq'Titan'){2575;exit}(696342,69911,58232,25362,24622,6371,6052,3390,2634,2440,2410,1822,1737,1561,1353,1186,1163,816,788)["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".indexOf(-join$a[0..1])/2]


                                                                              Try it online!



                                                                              Very similar to Olivier's answer, now that I see it, but developed independently.






                                                                              share|improve this answer









                                                                              $endgroup$




                                                                              PowerShell, 203 bytes, score 203





                                                                              param($a)if($a-eq'Titan'){2575;exit}(696342,69911,58232,25362,24622,6371,6052,3390,2634,2440,2410,1822,1737,1561,1353,1186,1163,816,788)["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".indexOf(-join$a[0..1])/2]


                                                                              Try it online!



                                                                              Very similar to Olivier's answer, now that I see it, but developed independently.







                                                                              share|improve this answer












                                                                              share|improve this answer



                                                                              share|improve this answer










                                                                              answered Dec 5 '18 at 15:35









                                                                              AdmBorkBorkAdmBorkBork

                                                                              27k366233




                                                                              27k366233























                                                                                  2












                                                                                  $begingroup$

                                                                                  T-SQL, 203 bytes, score = 217



                                                                                  SELECT IIF(v='Titan',26,SUBSTRING(value,3,4))*100
                                                                                  FROM i,STRING_SPLIT('Ca24,Ea64,Er12,Eu16,Ga26,Ha8,Io18,Ju699,Ma34,Me24,Mo17,Ne246,Pl12,Sa582,Su6963,Ti8,Tr14,Ur254,Ve61',',')
                                                                                  WHERE LEFT(v,2)=LEFT(value,2)


                                                                                  Line breaks are for readability only.



                                                                                  Input is taken via pre-existing table i with varchar column v, per our IO standards.



                                                                                  Joins the input table to an in-memory table on the first two characters, and returns the remaining digits x100.



                                                                                  Treats "Titan" as a special case using IIF.






                                                                                  share|improve this answer









                                                                                  $endgroup$


















                                                                                    2












                                                                                    $begingroup$

                                                                                    T-SQL, 203 bytes, score = 217



                                                                                    SELECT IIF(v='Titan',26,SUBSTRING(value,3,4))*100
                                                                                    FROM i,STRING_SPLIT('Ca24,Ea64,Er12,Eu16,Ga26,Ha8,Io18,Ju699,Ma34,Me24,Mo17,Ne246,Pl12,Sa582,Su6963,Ti8,Tr14,Ur254,Ve61',',')
                                                                                    WHERE LEFT(v,2)=LEFT(value,2)


                                                                                    Line breaks are for readability only.



                                                                                    Input is taken via pre-existing table i with varchar column v, per our IO standards.



                                                                                    Joins the input table to an in-memory table on the first two characters, and returns the remaining digits x100.



                                                                                    Treats "Titan" as a special case using IIF.






                                                                                    share|improve this answer









                                                                                    $endgroup$
















                                                                                      2












                                                                                      2








                                                                                      2





                                                                                      $begingroup$

                                                                                      T-SQL, 203 bytes, score = 217



                                                                                      SELECT IIF(v='Titan',26,SUBSTRING(value,3,4))*100
                                                                                      FROM i,STRING_SPLIT('Ca24,Ea64,Er12,Eu16,Ga26,Ha8,Io18,Ju699,Ma34,Me24,Mo17,Ne246,Pl12,Sa582,Su6963,Ti8,Tr14,Ur254,Ve61',',')
                                                                                      WHERE LEFT(v,2)=LEFT(value,2)


                                                                                      Line breaks are for readability only.



                                                                                      Input is taken via pre-existing table i with varchar column v, per our IO standards.



                                                                                      Joins the input table to an in-memory table on the first two characters, and returns the remaining digits x100.



                                                                                      Treats "Titan" as a special case using IIF.






                                                                                      share|improve this answer









                                                                                      $endgroup$



                                                                                      T-SQL, 203 bytes, score = 217



                                                                                      SELECT IIF(v='Titan',26,SUBSTRING(value,3,4))*100
                                                                                      FROM i,STRING_SPLIT('Ca24,Ea64,Er12,Eu16,Ga26,Ha8,Io18,Ju699,Ma34,Me24,Mo17,Ne246,Pl12,Sa582,Su6963,Ti8,Tr14,Ur254,Ve61',',')
                                                                                      WHERE LEFT(v,2)=LEFT(value,2)


                                                                                      Line breaks are for readability only.



                                                                                      Input is taken via pre-existing table i with varchar column v, per our IO standards.



                                                                                      Joins the input table to an in-memory table on the first two characters, and returns the remaining digits x100.



                                                                                      Treats "Titan" as a special case using IIF.







                                                                                      share|improve this answer












                                                                                      share|improve this answer



                                                                                      share|improve this answer










                                                                                      answered Dec 5 '18 at 23:19









                                                                                      BradCBradC

                                                                                      3,744523




                                                                                      3,744523























                                                                                          2












                                                                                          $begingroup$


                                                                                          Ruby, 105 bytes, score 109





                                                                                          ->n{7E5/('!)"0 r&zZ&1#}3Mfh-~~d@'[0,j=" =1&%)AM<I>2,-B#($D  7@".index((n[1,9].sum%50+34).chr)].sum-j*32)}


                                                                                          Try it online!



                                                                                          If we divide 700000 by the radii, we get a sequence which increases reasonably linearly (though rather erratically). The increments in the table below can be approximated by the ASCII values of characters. The problem with this approach is it requires the input to be decoded to a value which orders the different names by size.



                                                                                          A minor issue is that the difference between Eris and Haumea is quite large. Three characters ~~d are required to encode this increment in ASCII only format. The planet-to-index string has two "ghost planet"spaces in it to pad the index.



                                                                                          700000/r    increment from previous
                                                                                          0.994774
                                                                                          9.960407 8.965633
                                                                                          11.95806 1.997657
                                                                                          27.45612 15.49805
                                                                                          28.28129 0.825178
                                                                                          109.2987 81.0174
                                                                                          115.0598 5.761118
                                                                                          205.4106 90.3508
                                                                                          264.3667 58.95612
                                                                                          270.4241 6.057335
                                                                                          285.3861 14.96199
                                                                                          288.9386 3.552524
                                                                                          382.1855 93.24692
                                                                                          400.8877 18.70223
                                                                                          446.0871 45.19939
                                                                                          514.6652 68.57806
                                                                                          587.1349 72.46972
                                                                                          598.7463 11.61144
                                                                                          853.3603 254.6139
                                                                                          883.6827 30.32245





                                                                                          share|improve this answer











                                                                                          $endgroup$


















                                                                                            2












                                                                                            $begingroup$


                                                                                            Ruby, 105 bytes, score 109





                                                                                            ->n{7E5/('!)"0 r&zZ&1#}3Mfh-~~d@'[0,j=" =1&%)AM<I>2,-B#($D  7@".index((n[1,9].sum%50+34).chr)].sum-j*32)}


                                                                                            Try it online!



                                                                                            If we divide 700000 by the radii, we get a sequence which increases reasonably linearly (though rather erratically). The increments in the table below can be approximated by the ASCII values of characters. The problem with this approach is it requires the input to be decoded to a value which orders the different names by size.



                                                                                            A minor issue is that the difference between Eris and Haumea is quite large. Three characters ~~d are required to encode this increment in ASCII only format. The planet-to-index string has two "ghost planet"spaces in it to pad the index.



                                                                                            700000/r    increment from previous
                                                                                            0.994774
                                                                                            9.960407 8.965633
                                                                                            11.95806 1.997657
                                                                                            27.45612 15.49805
                                                                                            28.28129 0.825178
                                                                                            109.2987 81.0174
                                                                                            115.0598 5.761118
                                                                                            205.4106 90.3508
                                                                                            264.3667 58.95612
                                                                                            270.4241 6.057335
                                                                                            285.3861 14.96199
                                                                                            288.9386 3.552524
                                                                                            382.1855 93.24692
                                                                                            400.8877 18.70223
                                                                                            446.0871 45.19939
                                                                                            514.6652 68.57806
                                                                                            587.1349 72.46972
                                                                                            598.7463 11.61144
                                                                                            853.3603 254.6139
                                                                                            883.6827 30.32245





                                                                                            share|improve this answer











                                                                                            $endgroup$
















                                                                                              2












                                                                                              2








                                                                                              2





                                                                                              $begingroup$


                                                                                              Ruby, 105 bytes, score 109





                                                                                              ->n{7E5/('!)"0 r&zZ&1#}3Mfh-~~d@'[0,j=" =1&%)AM<I>2,-B#($D  7@".index((n[1,9].sum%50+34).chr)].sum-j*32)}


                                                                                              Try it online!



                                                                                              If we divide 700000 by the radii, we get a sequence which increases reasonably linearly (though rather erratically). The increments in the table below can be approximated by the ASCII values of characters. The problem with this approach is it requires the input to be decoded to a value which orders the different names by size.



                                                                                              A minor issue is that the difference between Eris and Haumea is quite large. Three characters ~~d are required to encode this increment in ASCII only format. The planet-to-index string has two "ghost planet"spaces in it to pad the index.



                                                                                              700000/r    increment from previous
                                                                                              0.994774
                                                                                              9.960407 8.965633
                                                                                              11.95806 1.997657
                                                                                              27.45612 15.49805
                                                                                              28.28129 0.825178
                                                                                              109.2987 81.0174
                                                                                              115.0598 5.761118
                                                                                              205.4106 90.3508
                                                                                              264.3667 58.95612
                                                                                              270.4241 6.057335
                                                                                              285.3861 14.96199
                                                                                              288.9386 3.552524
                                                                                              382.1855 93.24692
                                                                                              400.8877 18.70223
                                                                                              446.0871 45.19939
                                                                                              514.6652 68.57806
                                                                                              587.1349 72.46972
                                                                                              598.7463 11.61144
                                                                                              853.3603 254.6139
                                                                                              883.6827 30.32245





                                                                                              share|improve this answer











                                                                                              $endgroup$




                                                                                              Ruby, 105 bytes, score 109





                                                                                              ->n{7E5/('!)"0 r&zZ&1#}3Mfh-~~d@'[0,j=" =1&%)AM<I>2,-B#($D  7@".index((n[1,9].sum%50+34).chr)].sum-j*32)}


                                                                                              Try it online!



                                                                                              If we divide 700000 by the radii, we get a sequence which increases reasonably linearly (though rather erratically). The increments in the table below can be approximated by the ASCII values of characters. The problem with this approach is it requires the input to be decoded to a value which orders the different names by size.



                                                                                              A minor issue is that the difference between Eris and Haumea is quite large. Three characters ~~d are required to encode this increment in ASCII only format. The planet-to-index string has two "ghost planet"spaces in it to pad the index.



                                                                                              700000/r    increment from previous
                                                                                              0.994774
                                                                                              9.960407 8.965633
                                                                                              11.95806 1.997657
                                                                                              27.45612 15.49805
                                                                                              28.28129 0.825178
                                                                                              109.2987 81.0174
                                                                                              115.0598 5.761118
                                                                                              205.4106 90.3508
                                                                                              264.3667 58.95612
                                                                                              270.4241 6.057335
                                                                                              285.3861 14.96199
                                                                                              288.9386 3.552524
                                                                                              382.1855 93.24692
                                                                                              400.8877 18.70223
                                                                                              446.0871 45.19939
                                                                                              514.6652 68.57806
                                                                                              587.1349 72.46972
                                                                                              598.7463 11.61144
                                                                                              853.3603 254.6139
                                                                                              883.6827 30.32245






                                                                                              share|improve this answer














                                                                                              share|improve this answer



                                                                                              share|improve this answer








                                                                                              edited Dec 7 '18 at 0:16

























                                                                                              answered Dec 6 '18 at 2:09









                                                                                              Level River StLevel River St

                                                                                              20.3k32679




                                                                                              20.3k32679























                                                                                                  1












                                                                                                  $begingroup$


                                                                                                  Charcoal, 101 bytes, score = 101



                                                                                                  I⍘§⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²⁺§θ⁰§θχγ


                                                                                                  Try it online! Link is to verbose version of code. Explanation:



                                                                                                  ⁺§θ⁰§θχ


                                                                                                  Take the 1st and 11th character (cyclically) of the input string and concatenate them.



                                                                                                  ⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²


                                                                                                  Look them up in the string SuJiSrUuNtEEVVMrGnTTMcClIIMoEpToPPEiHeTa split into pairs of characters.



                                                                                                  §⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³


                                                                                                  Split the string m.w'fv&J|"l|"e1 c& _c Ca ;e ;* 9a 9C 31 2; 0I .7 ,N ,7 (X (< into groups of three characters and take the corresponding group.



                                                                                                  I⍘ ... γ


                                                                                                  Decode the result as a base-95 number using the printable ASCII character set as the digits. Example: Io's 11th character is I, so we look up II and find it's the 13th largest object and its size is 31 which maps to 19 * 95 + 17 = 1822.






                                                                                                  share|improve this answer











                                                                                                  $endgroup$


















                                                                                                    1












                                                                                                    $begingroup$


                                                                                                    Charcoal, 101 bytes, score = 101



                                                                                                    I⍘§⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²⁺§θ⁰§θχγ


                                                                                                    Try it online! Link is to verbose version of code. Explanation:



                                                                                                    ⁺§θ⁰§θχ


                                                                                                    Take the 1st and 11th character (cyclically) of the input string and concatenate them.



                                                                                                    ⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²


                                                                                                    Look them up in the string SuJiSrUuNtEEVVMrGnTTMcClIIMoEpToPPEiHeTa split into pairs of characters.



                                                                                                    §⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³


                                                                                                    Split the string m.w'fv&J|"l|"e1 c& _c Ca ;e ;* 9a 9C 31 2; 0I .7 ,N ,7 (X (< into groups of three characters and take the corresponding group.



                                                                                                    I⍘ ... γ


                                                                                                    Decode the result as a base-95 number using the printable ASCII character set as the digits. Example: Io's 11th character is I, so we look up II and find it's the 13th largest object and its size is 31 which maps to 19 * 95 + 17 = 1822.






                                                                                                    share|improve this answer











                                                                                                    $endgroup$
















                                                                                                      1












                                                                                                      1








                                                                                                      1





                                                                                                      $begingroup$


                                                                                                      Charcoal, 101 bytes, score = 101



                                                                                                      I⍘§⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²⁺§θ⁰§θχγ


                                                                                                      Try it online! Link is to verbose version of code. Explanation:



                                                                                                      ⁺§θ⁰§θχ


                                                                                                      Take the 1st and 11th character (cyclically) of the input string and concatenate them.



                                                                                                      ⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²


                                                                                                      Look them up in the string SuJiSrUuNtEEVVMrGnTTMcClIIMoEpToPPEiHeTa split into pairs of characters.



                                                                                                      §⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³


                                                                                                      Split the string m.w'fv&J|"l|"e1 c& _c Ca ;e ;* 9a 9C 31 2; 0I .7 ,N ,7 (X (< into groups of three characters and take the corresponding group.



                                                                                                      I⍘ ... γ


                                                                                                      Decode the result as a base-95 number using the printable ASCII character set as the digits. Example: Io's 11th character is I, so we look up II and find it's the 13th largest object and its size is 31 which maps to 19 * 95 + 17 = 1822.






                                                                                                      share|improve this answer











                                                                                                      $endgroup$




                                                                                                      Charcoal, 101 bytes, score = 101



                                                                                                      I⍘§⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²⁺§θ⁰§θχγ


                                                                                                      Try it online! Link is to verbose version of code. Explanation:



                                                                                                      ⁺§θ⁰§θχ


                                                                                                      Take the 1st and 11th character (cyclically) of the input string and concatenate them.



                                                                                                      ⌕⪪”@/rjmq_↙§E▶νF↨oº⁷÷K⁻eDH:_Tbk¦�”²


                                                                                                      Look them up in the string SuJiSrUuNtEEVVMrGnTTMcClIIMoEpToPPEiHeTa split into pairs of characters.



                                                                                                      §⪪“_″FJ⁼⦄bl≕)T‹#⊙xO-nη⁻À↓ζ↥ς§%H8H“ρj✳Hρl× S↶…|UD⎇LkfZ”³


                                                                                                      Split the string m.w'fv&J|"l|"e1 c& _c Ca ;e ;* 9a 9C 31 2; 0I .7 ,N ,7 (X (< into groups of three characters and take the corresponding group.



                                                                                                      I⍘ ... γ


                                                                                                      Decode the result as a base-95 number using the printable ASCII character set as the digits. Example: Io's 11th character is I, so we look up II and find it's the 13th largest object and its size is 31 which maps to 19 * 95 + 17 = 1822.







                                                                                                      share|improve this answer














                                                                                                      share|improve this answer



                                                                                                      share|improve this answer








                                                                                                      edited Dec 6 '18 at 21:03

























                                                                                                      answered Dec 6 '18 at 19:56









                                                                                                      NeilNeil

                                                                                                      80.4k744178




                                                                                                      80.4k744178























                                                                                                          1












                                                                                                          $begingroup$


                                                                                                          Swift 4, 225 bytes, score = 241



                                                                                                          Probably golfable a bunch more (maybe in the "Ga-Me-Ca" area?), but Swift is not often used (for a reason, maybe.)



                                                                                                          func b(i:String){print(i=="Titan" ?2575:["Su":6963,"Ju":699,"Sa":582,"Ur":253,"Ne":246,"Ea":63,"Ve":60,"Ma":33,"Ga":26,"Me":24,"Ca":24,"Io":18,"Mo":17,"Eu":16,"Tr":14,"Pl":12,"Er":12,"Ha":8,"Ti":8][String(i.prefix(2))]!*100)}


                                                                                                          and ungolfed



                                                                                                          func size(ofAstralObject object: String) {
                                                                                                          let objectToRadius = // Map size/100 of all objects to the first two chars
                                                                                                          ["Su":6963,
                                                                                                          "Ju":699,
                                                                                                          "Sa":582,
                                                                                                          "Ur":253,
                                                                                                          "Ne":246,
                                                                                                          "Ea":63,
                                                                                                          "Ve":60,
                                                                                                          "Ma":33,
                                                                                                          "Ga":26,
                                                                                                          "Me":24,
                                                                                                          "Ca":24,
                                                                                                          "Io":18,
                                                                                                          "Mo":17,
                                                                                                          "Eu":16,
                                                                                                          "Tr":14,
                                                                                                          "Pl":12,
                                                                                                          "Er":12,
                                                                                                          "Ha":8,
                                                                                                          "Ti":8] // Ti is Titania, while Titan is treated differently

                                                                                                          print(object == "Titan" ?
                                                                                                          2575 : // If "Titan", print the exact size
                                                                                                          objectToRadius[String(i.prefix(2))]!*100 // get the size from the map and multiply by 100
                                                                                                          )
                                                                                                          }


                                                                                                          Try It Online!



                                                                                                          I tried different "key sizes" for the map, but of course 1 has many clashes and using three chars doesn't give me i=="Titan" ?2575:'s 17 chars, since there's "Io" to manage (and it'll take more than 3 chars, I think).






                                                                                                          share|improve this answer









                                                                                                          $endgroup$


















                                                                                                            1












                                                                                                            $begingroup$


                                                                                                            Swift 4, 225 bytes, score = 241



                                                                                                            Probably golfable a bunch more (maybe in the "Ga-Me-Ca" area?), but Swift is not often used (for a reason, maybe.)



                                                                                                            func b(i:String){print(i=="Titan" ?2575:["Su":6963,"Ju":699,"Sa":582,"Ur":253,"Ne":246,"Ea":63,"Ve":60,"Ma":33,"Ga":26,"Me":24,"Ca":24,"Io":18,"Mo":17,"Eu":16,"Tr":14,"Pl":12,"Er":12,"Ha":8,"Ti":8][String(i.prefix(2))]!*100)}


                                                                                                            and ungolfed



                                                                                                            func size(ofAstralObject object: String) {
                                                                                                            let objectToRadius = // Map size/100 of all objects to the first two chars
                                                                                                            ["Su":6963,
                                                                                                            "Ju":699,
                                                                                                            "Sa":582,
                                                                                                            "Ur":253,
                                                                                                            "Ne":246,
                                                                                                            "Ea":63,
                                                                                                            "Ve":60,
                                                                                                            "Ma":33,
                                                                                                            "Ga":26,
                                                                                                            "Me":24,
                                                                                                            "Ca":24,
                                                                                                            "Io":18,
                                                                                                            "Mo":17,
                                                                                                            "Eu":16,
                                                                                                            "Tr":14,
                                                                                                            "Pl":12,
                                                                                                            "Er":12,
                                                                                                            "Ha":8,
                                                                                                            "Ti":8] // Ti is Titania, while Titan is treated differently

                                                                                                            print(object == "Titan" ?
                                                                                                            2575 : // If "Titan", print the exact size
                                                                                                            objectToRadius[String(i.prefix(2))]!*100 // get the size from the map and multiply by 100
                                                                                                            )
                                                                                                            }


                                                                                                            Try It Online!



                                                                                                            I tried different "key sizes" for the map, but of course 1 has many clashes and using three chars doesn't give me i=="Titan" ?2575:'s 17 chars, since there's "Io" to manage (and it'll take more than 3 chars, I think).






                                                                                                            share|improve this answer









                                                                                                            $endgroup$
















                                                                                                              1












                                                                                                              1








                                                                                                              1





                                                                                                              $begingroup$


                                                                                                              Swift 4, 225 bytes, score = 241



                                                                                                              Probably golfable a bunch more (maybe in the "Ga-Me-Ca" area?), but Swift is not often used (for a reason, maybe.)



                                                                                                              func b(i:String){print(i=="Titan" ?2575:["Su":6963,"Ju":699,"Sa":582,"Ur":253,"Ne":246,"Ea":63,"Ve":60,"Ma":33,"Ga":26,"Me":24,"Ca":24,"Io":18,"Mo":17,"Eu":16,"Tr":14,"Pl":12,"Er":12,"Ha":8,"Ti":8][String(i.prefix(2))]!*100)}


                                                                                                              and ungolfed



                                                                                                              func size(ofAstralObject object: String) {
                                                                                                              let objectToRadius = // Map size/100 of all objects to the first two chars
                                                                                                              ["Su":6963,
                                                                                                              "Ju":699,
                                                                                                              "Sa":582,
                                                                                                              "Ur":253,
                                                                                                              "Ne":246,
                                                                                                              "Ea":63,
                                                                                                              "Ve":60,
                                                                                                              "Ma":33,
                                                                                                              "Ga":26,
                                                                                                              "Me":24,
                                                                                                              "Ca":24,
                                                                                                              "Io":18,
                                                                                                              "Mo":17,
                                                                                                              "Eu":16,
                                                                                                              "Tr":14,
                                                                                                              "Pl":12,
                                                                                                              "Er":12,
                                                                                                              "Ha":8,
                                                                                                              "Ti":8] // Ti is Titania, while Titan is treated differently

                                                                                                              print(object == "Titan" ?
                                                                                                              2575 : // If "Titan", print the exact size
                                                                                                              objectToRadius[String(i.prefix(2))]!*100 // get the size from the map and multiply by 100
                                                                                                              )
                                                                                                              }


                                                                                                              Try It Online!



                                                                                                              I tried different "key sizes" for the map, but of course 1 has many clashes and using three chars doesn't give me i=="Titan" ?2575:'s 17 chars, since there's "Io" to manage (and it'll take more than 3 chars, I think).






                                                                                                              share|improve this answer









                                                                                                              $endgroup$




                                                                                                              Swift 4, 225 bytes, score = 241



                                                                                                              Probably golfable a bunch more (maybe in the "Ga-Me-Ca" area?), but Swift is not often used (for a reason, maybe.)



                                                                                                              func b(i:String){print(i=="Titan" ?2575:["Su":6963,"Ju":699,"Sa":582,"Ur":253,"Ne":246,"Ea":63,"Ve":60,"Ma":33,"Ga":26,"Me":24,"Ca":24,"Io":18,"Mo":17,"Eu":16,"Tr":14,"Pl":12,"Er":12,"Ha":8,"Ti":8][String(i.prefix(2))]!*100)}


                                                                                                              and ungolfed



                                                                                                              func size(ofAstralObject object: String) {
                                                                                                              let objectToRadius = // Map size/100 of all objects to the first two chars
                                                                                                              ["Su":6963,
                                                                                                              "Ju":699,
                                                                                                              "Sa":582,
                                                                                                              "Ur":253,
                                                                                                              "Ne":246,
                                                                                                              "Ea":63,
                                                                                                              "Ve":60,
                                                                                                              "Ma":33,
                                                                                                              "Ga":26,
                                                                                                              "Me":24,
                                                                                                              "Ca":24,
                                                                                                              "Io":18,
                                                                                                              "Mo":17,
                                                                                                              "Eu":16,
                                                                                                              "Tr":14,
                                                                                                              "Pl":12,
                                                                                                              "Er":12,
                                                                                                              "Ha":8,
                                                                                                              "Ti":8] // Ti is Titania, while Titan is treated differently

                                                                                                              print(object == "Titan" ?
                                                                                                              2575 : // If "Titan", print the exact size
                                                                                                              objectToRadius[String(i.prefix(2))]!*100 // get the size from the map and multiply by 100
                                                                                                              )
                                                                                                              }


                                                                                                              Try It Online!



                                                                                                              I tried different "key sizes" for the map, but of course 1 has many clashes and using three chars doesn't give me i=="Titan" ?2575:'s 17 chars, since there's "Io" to manage (and it'll take more than 3 chars, I think).







                                                                                                              share|improve this answer












                                                                                                              share|improve this answer



                                                                                                              share|improve this answer










                                                                                                              answered Dec 7 '18 at 12:27









                                                                                                              Simone CheloSimone Chelo

                                                                                                              45348




                                                                                                              45348























                                                                                                                  1












                                                                                                                  $begingroup$

                                                                                                                  JavaScript (ES6), 152 bytes, score = 163



                                                                                                                  Well, it's a pretty standard solution, but I enjoyed the challenge anyway!



                                                                                                                  s=>s=='Titan'?2575:[6963,699,582,254,246,64,60,34,26,24,24,18,17,16,14,12,12,8,8]["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".match(s[0]+s[1]).index/2]*100


                                                                                                                  My Score:



                                                                                                                  Max. penalty ratio = 1.07068 for Triton
                                                                                                                  Score = ceil(152 x 1.07068) = 163


                                                                                                                  Try it Online!






                                                                                                                  share|improve this answer









                                                                                                                  $endgroup$


















                                                                                                                    1












                                                                                                                    $begingroup$

                                                                                                                    JavaScript (ES6), 152 bytes, score = 163



                                                                                                                    Well, it's a pretty standard solution, but I enjoyed the challenge anyway!



                                                                                                                    s=>s=='Titan'?2575:[6963,699,582,254,246,64,60,34,26,24,24,18,17,16,14,12,12,8,8]["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".match(s[0]+s[1]).index/2]*100


                                                                                                                    My Score:



                                                                                                                    Max. penalty ratio = 1.07068 for Triton
                                                                                                                    Score = ceil(152 x 1.07068) = 163


                                                                                                                    Try it Online!






                                                                                                                    share|improve this answer









                                                                                                                    $endgroup$
















                                                                                                                      1












                                                                                                                      1








                                                                                                                      1





                                                                                                                      $begingroup$

                                                                                                                      JavaScript (ES6), 152 bytes, score = 163



                                                                                                                      Well, it's a pretty standard solution, but I enjoyed the challenge anyway!



                                                                                                                      s=>s=='Titan'?2575:[6963,699,582,254,246,64,60,34,26,24,24,18,17,16,14,12,12,8,8]["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".match(s[0]+s[1]).index/2]*100


                                                                                                                      My Score:



                                                                                                                      Max. penalty ratio = 1.07068 for Triton
                                                                                                                      Score = ceil(152 x 1.07068) = 163


                                                                                                                      Try it Online!






                                                                                                                      share|improve this answer









                                                                                                                      $endgroup$



                                                                                                                      JavaScript (ES6), 152 bytes, score = 163



                                                                                                                      Well, it's a pretty standard solution, but I enjoyed the challenge anyway!



                                                                                                                      s=>s=='Titan'?2575:[6963,699,582,254,246,64,60,34,26,24,24,18,17,16,14,12,12,8,8]["SuJuSaUrNeEaVeMaGaMeCaIoMoEuTrPlErHaTi".match(s[0]+s[1]).index/2]*100


                                                                                                                      My Score:



                                                                                                                      Max. penalty ratio = 1.07068 for Triton
                                                                                                                      Score = ceil(152 x 1.07068) = 163


                                                                                                                      Try it Online!







                                                                                                                      share|improve this answer












                                                                                                                      share|improve this answer



                                                                                                                      share|improve this answer










                                                                                                                      answered Dec 11 '18 at 11:18









                                                                                                                      zruFzruF

                                                                                                                      595




                                                                                                                      595























                                                                                                                          1












                                                                                                                          $begingroup$


                                                                                                                          FALSE, 152 bytes, Score = 563



                                                                                                                          [911*.]^$0[~][1+^]#$$2=$4=8=||[2 0!]?$3=[764 0!]?$5=[$$69=86=|$[6]?~[2]?0!]?$6=[$$83=85=|$[46]?~[$72=$[1]?~[2]?]?0!]?$7=[$84=$[1]?~[52]?0!]?


                                                                                                                          Lazy answer using word lengths and first letters but my excuse is that I'm using a weird language



                                                                                                                          Try it online! (copy paste the code, hit show and then run)



                                                                                                                          [911*.]          {defines a function that multiplies a number by 911 and then prints it}
                                                                                                                          ^$0[~][1+^]# {counts the length of the name as it's input, also records the first char}
                                                                                                                          $$2=$4=8=||[1 0!]? {if the name is 2, 4, or 8 chars long print 911*2 (0! calls the function)}
                                                                                                                          $3=[764 0!]? {if name is 3 long print 911*764}
                                                                                                                          $5=[$$69=86=|$[6]?~[2]?0!]? {5 long? print 911*6 if it starts with E or V, otherwise *2}
                                                                                                                          $6=[$$83=85=|$[46]?~[ {6 long? print 911*46 if it starts with S or U, otherwise:}
                                                                                                                          $72=$[1]?~[2]? {if name starts with H print 911*1 else *2
                                                                                                                          ]?0!]?
                                                                                                                          $7=[$84=$[1]?~[26]?0!]? {7 long? print 1822*1 if it starts with NT otherwise *26 (for jupiter}


                                                                                                                          My results:



                                                                                                                          Sun       : 696004.00 penalty ratio = (696342.00 / 696004.00 )² = 1.00097
                                                                                                                          Jupiter : 47372.00 penalty ratio = (69911.00 / 47372.00 )² = 2.17795
                                                                                                                          Saturn : 41906.00 penalty ratio = (58232.00 / 41906.00 )² = 1.93095
                                                                                                                          Uranus : 41906.00 penalty ratio = (41906.00 / 25362.00 )² = 2.73014
                                                                                                                          Neptune : 47372.00 penalty ratio = (47372.00 / 24622.00 )² = 3.70166
                                                                                                                          Earth : 5466.00 penalty ratio = (6371.00 / 5466.00 )² = 1.35855
                                                                                                                          Venus : 5466.00 penalty ratio = (6052.00 / 5466.00 )² = 1.22591
                                                                                                                          Mars : 1822.00 penalty ratio = (3390.00 / 1822.00 )² = 3.46181
                                                                                                                          Ganymede : 1822.00 penalty ratio = (2634.00 / 1822.00 )² = 2.08994
                                                                                                                          Titan : 1822.00 penalty ratio = (2575.00 / 1822.00 )² = 1.99737
                                                                                                                          Mercury : 1822.00 penalty ratio = (2440.00 / 1822.00 )² = 1.79342
                                                                                                                          Callisto : 1822.00 penalty ratio = (2410.00 / 1822.00 )² = 1.74959
                                                                                                                          Io : 1822.00 penalty ratio = (1822.00 / 1822.00 )² = 1.00000
                                                                                                                          Moon : 1822.00 penalty ratio = (1822.00 / 1737.00 )² = 1.10026
                                                                                                                          Europa : 1822.00 penalty ratio = (1822.00 / 1561.00 )² = 1.36236
                                                                                                                          Triton : 1822.00 penalty ratio = (1822.00 / 1353.00 )² = 1.81343
                                                                                                                          Pluto : 1822.00 penalty ratio = (1822.00 / 1186.00 )² = 2.36008
                                                                                                                          Eris : 1822.00 penalty ratio = (1822.00 / 1163.00 )² = 2.45435
                                                                                                                          Haumea : 911.00 penalty ratio = (911.00 / 816.00 )² = 1.24640
                                                                                                                          Titania : 911.00 penalty ratio = (911.00 / 788.00 )² = 1.33655

                                                                                                                          Max. penalty ratio = 3.70166 for Neptune
                                                                                                                          Score = ceil(152 x 3.70166) = 563





                                                                                                                          share|improve this answer











                                                                                                                          $endgroup$













                                                                                                                          • $begingroup$
                                                                                                                            It seems like the optimal multiplier for your current code is $1634$.
                                                                                                                            $endgroup$
                                                                                                                            – Arnauld
                                                                                                                            Dec 12 '18 at 2:36










                                                                                                                          • $begingroup$
                                                                                                                            I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                                                                                                                            $endgroup$
                                                                                                                            – Terjerber
                                                                                                                            Dec 12 '18 at 2:52
















                                                                                                                          1












                                                                                                                          $begingroup$


                                                                                                                          FALSE, 152 bytes, Score = 563



                                                                                                                          [911*.]^$0[~][1+^]#$$2=$4=8=||[2 0!]?$3=[764 0!]?$5=[$$69=86=|$[6]?~[2]?0!]?$6=[$$83=85=|$[46]?~[$72=$[1]?~[2]?]?0!]?$7=[$84=$[1]?~[52]?0!]?


                                                                                                                          Lazy answer using word lengths and first letters but my excuse is that I'm using a weird language



                                                                                                                          Try it online! (copy paste the code, hit show and then run)



                                                                                                                          [911*.]          {defines a function that multiplies a number by 911 and then prints it}
                                                                                                                          ^$0[~][1+^]# {counts the length of the name as it's input, also records the first char}
                                                                                                                          $$2=$4=8=||[1 0!]? {if the name is 2, 4, or 8 chars long print 911*2 (0! calls the function)}
                                                                                                                          $3=[764 0!]? {if name is 3 long print 911*764}
                                                                                                                          $5=[$$69=86=|$[6]?~[2]?0!]? {5 long? print 911*6 if it starts with E or V, otherwise *2}
                                                                                                                          $6=[$$83=85=|$[46]?~[ {6 long? print 911*46 if it starts with S or U, otherwise:}
                                                                                                                          $72=$[1]?~[2]? {if name starts with H print 911*1 else *2
                                                                                                                          ]?0!]?
                                                                                                                          $7=[$84=$[1]?~[26]?0!]? {7 long? print 1822*1 if it starts with NT otherwise *26 (for jupiter}


                                                                                                                          My results:



                                                                                                                          Sun       : 696004.00 penalty ratio = (696342.00 / 696004.00 )² = 1.00097
                                                                                                                          Jupiter : 47372.00 penalty ratio = (69911.00 / 47372.00 )² = 2.17795
                                                                                                                          Saturn : 41906.00 penalty ratio = (58232.00 / 41906.00 )² = 1.93095
                                                                                                                          Uranus : 41906.00 penalty ratio = (41906.00 / 25362.00 )² = 2.73014
                                                                                                                          Neptune : 47372.00 penalty ratio = (47372.00 / 24622.00 )² = 3.70166
                                                                                                                          Earth : 5466.00 penalty ratio = (6371.00 / 5466.00 )² = 1.35855
                                                                                                                          Venus : 5466.00 penalty ratio = (6052.00 / 5466.00 )² = 1.22591
                                                                                                                          Mars : 1822.00 penalty ratio = (3390.00 / 1822.00 )² = 3.46181
                                                                                                                          Ganymede : 1822.00 penalty ratio = (2634.00 / 1822.00 )² = 2.08994
                                                                                                                          Titan : 1822.00 penalty ratio = (2575.00 / 1822.00 )² = 1.99737
                                                                                                                          Mercury : 1822.00 penalty ratio = (2440.00 / 1822.00 )² = 1.79342
                                                                                                                          Callisto : 1822.00 penalty ratio = (2410.00 / 1822.00 )² = 1.74959
                                                                                                                          Io : 1822.00 penalty ratio = (1822.00 / 1822.00 )² = 1.00000
                                                                                                                          Moon : 1822.00 penalty ratio = (1822.00 / 1737.00 )² = 1.10026
                                                                                                                          Europa : 1822.00 penalty ratio = (1822.00 / 1561.00 )² = 1.36236
                                                                                                                          Triton : 1822.00 penalty ratio = (1822.00 / 1353.00 )² = 1.81343
                                                                                                                          Pluto : 1822.00 penalty ratio = (1822.00 / 1186.00 )² = 2.36008
                                                                                                                          Eris : 1822.00 penalty ratio = (1822.00 / 1163.00 )² = 2.45435
                                                                                                                          Haumea : 911.00 penalty ratio = (911.00 / 816.00 )² = 1.24640
                                                                                                                          Titania : 911.00 penalty ratio = (911.00 / 788.00 )² = 1.33655

                                                                                                                          Max. penalty ratio = 3.70166 for Neptune
                                                                                                                          Score = ceil(152 x 3.70166) = 563





                                                                                                                          share|improve this answer











                                                                                                                          $endgroup$













                                                                                                                          • $begingroup$
                                                                                                                            It seems like the optimal multiplier for your current code is $1634$.
                                                                                                                            $endgroup$
                                                                                                                            – Arnauld
                                                                                                                            Dec 12 '18 at 2:36










                                                                                                                          • $begingroup$
                                                                                                                            I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                                                                                                                            $endgroup$
                                                                                                                            – Terjerber
                                                                                                                            Dec 12 '18 at 2:52














                                                                                                                          1












                                                                                                                          1








                                                                                                                          1





                                                                                                                          $begingroup$


                                                                                                                          FALSE, 152 bytes, Score = 563



                                                                                                                          [911*.]^$0[~][1+^]#$$2=$4=8=||[2 0!]?$3=[764 0!]?$5=[$$69=86=|$[6]?~[2]?0!]?$6=[$$83=85=|$[46]?~[$72=$[1]?~[2]?]?0!]?$7=[$84=$[1]?~[52]?0!]?


                                                                                                                          Lazy answer using word lengths and first letters but my excuse is that I'm using a weird language



                                                                                                                          Try it online! (copy paste the code, hit show and then run)



                                                                                                                          [911*.]          {defines a function that multiplies a number by 911 and then prints it}
                                                                                                                          ^$0[~][1+^]# {counts the length of the name as it's input, also records the first char}
                                                                                                                          $$2=$4=8=||[1 0!]? {if the name is 2, 4, or 8 chars long print 911*2 (0! calls the function)}
                                                                                                                          $3=[764 0!]? {if name is 3 long print 911*764}
                                                                                                                          $5=[$$69=86=|$[6]?~[2]?0!]? {5 long? print 911*6 if it starts with E or V, otherwise *2}
                                                                                                                          $6=[$$83=85=|$[46]?~[ {6 long? print 911*46 if it starts with S or U, otherwise:}
                                                                                                                          $72=$[1]?~[2]? {if name starts with H print 911*1 else *2
                                                                                                                          ]?0!]?
                                                                                                                          $7=[$84=$[1]?~[26]?0!]? {7 long? print 1822*1 if it starts with NT otherwise *26 (for jupiter}


                                                                                                                          My results:



                                                                                                                          Sun       : 696004.00 penalty ratio = (696342.00 / 696004.00 )² = 1.00097
                                                                                                                          Jupiter : 47372.00 penalty ratio = (69911.00 / 47372.00 )² = 2.17795
                                                                                                                          Saturn : 41906.00 penalty ratio = (58232.00 / 41906.00 )² = 1.93095
                                                                                                                          Uranus : 41906.00 penalty ratio = (41906.00 / 25362.00 )² = 2.73014
                                                                                                                          Neptune : 47372.00 penalty ratio = (47372.00 / 24622.00 )² = 3.70166
                                                                                                                          Earth : 5466.00 penalty ratio = (6371.00 / 5466.00 )² = 1.35855
                                                                                                                          Venus : 5466.00 penalty ratio = (6052.00 / 5466.00 )² = 1.22591
                                                                                                                          Mars : 1822.00 penalty ratio = (3390.00 / 1822.00 )² = 3.46181
                                                                                                                          Ganymede : 1822.00 penalty ratio = (2634.00 / 1822.00 )² = 2.08994
                                                                                                                          Titan : 1822.00 penalty ratio = (2575.00 / 1822.00 )² = 1.99737
                                                                                                                          Mercury : 1822.00 penalty ratio = (2440.00 / 1822.00 )² = 1.79342
                                                                                                                          Callisto : 1822.00 penalty ratio = (2410.00 / 1822.00 )² = 1.74959
                                                                                                                          Io : 1822.00 penalty ratio = (1822.00 / 1822.00 )² = 1.00000
                                                                                                                          Moon : 1822.00 penalty ratio = (1822.00 / 1737.00 )² = 1.10026
                                                                                                                          Europa : 1822.00 penalty ratio = (1822.00 / 1561.00 )² = 1.36236
                                                                                                                          Triton : 1822.00 penalty ratio = (1822.00 / 1353.00 )² = 1.81343
                                                                                                                          Pluto : 1822.00 penalty ratio = (1822.00 / 1186.00 )² = 2.36008
                                                                                                                          Eris : 1822.00 penalty ratio = (1822.00 / 1163.00 )² = 2.45435
                                                                                                                          Haumea : 911.00 penalty ratio = (911.00 / 816.00 )² = 1.24640
                                                                                                                          Titania : 911.00 penalty ratio = (911.00 / 788.00 )² = 1.33655

                                                                                                                          Max. penalty ratio = 3.70166 for Neptune
                                                                                                                          Score = ceil(152 x 3.70166) = 563





                                                                                                                          share|improve this answer











                                                                                                                          $endgroup$




                                                                                                                          FALSE, 152 bytes, Score = 563



                                                                                                                          [911*.]^$0[~][1+^]#$$2=$4=8=||[2 0!]?$3=[764 0!]?$5=[$$69=86=|$[6]?~[2]?0!]?$6=[$$83=85=|$[46]?~[$72=$[1]?~[2]?]?0!]?$7=[$84=$[1]?~[52]?0!]?


                                                                                                                          Lazy answer using word lengths and first letters but my excuse is that I'm using a weird language



                                                                                                                          Try it online! (copy paste the code, hit show and then run)



                                                                                                                          [911*.]          {defines a function that multiplies a number by 911 and then prints it}
                                                                                                                          ^$0[~][1+^]# {counts the length of the name as it's input, also records the first char}
                                                                                                                          $$2=$4=8=||[1 0!]? {if the name is 2, 4, or 8 chars long print 911*2 (0! calls the function)}
                                                                                                                          $3=[764 0!]? {if name is 3 long print 911*764}
                                                                                                                          $5=[$$69=86=|$[6]?~[2]?0!]? {5 long? print 911*6 if it starts with E or V, otherwise *2}
                                                                                                                          $6=[$$83=85=|$[46]?~[ {6 long? print 911*46 if it starts with S or U, otherwise:}
                                                                                                                          $72=$[1]?~[2]? {if name starts with H print 911*1 else *2
                                                                                                                          ]?0!]?
                                                                                                                          $7=[$84=$[1]?~[26]?0!]? {7 long? print 1822*1 if it starts with NT otherwise *26 (for jupiter}


                                                                                                                          My results:



                                                                                                                          Sun       : 696004.00 penalty ratio = (696342.00 / 696004.00 )² = 1.00097
                                                                                                                          Jupiter : 47372.00 penalty ratio = (69911.00 / 47372.00 )² = 2.17795
                                                                                                                          Saturn : 41906.00 penalty ratio = (58232.00 / 41906.00 )² = 1.93095
                                                                                                                          Uranus : 41906.00 penalty ratio = (41906.00 / 25362.00 )² = 2.73014
                                                                                                                          Neptune : 47372.00 penalty ratio = (47372.00 / 24622.00 )² = 3.70166
                                                                                                                          Earth : 5466.00 penalty ratio = (6371.00 / 5466.00 )² = 1.35855
                                                                                                                          Venus : 5466.00 penalty ratio = (6052.00 / 5466.00 )² = 1.22591
                                                                                                                          Mars : 1822.00 penalty ratio = (3390.00 / 1822.00 )² = 3.46181
                                                                                                                          Ganymede : 1822.00 penalty ratio = (2634.00 / 1822.00 )² = 2.08994
                                                                                                                          Titan : 1822.00 penalty ratio = (2575.00 / 1822.00 )² = 1.99737
                                                                                                                          Mercury : 1822.00 penalty ratio = (2440.00 / 1822.00 )² = 1.79342
                                                                                                                          Callisto : 1822.00 penalty ratio = (2410.00 / 1822.00 )² = 1.74959
                                                                                                                          Io : 1822.00 penalty ratio = (1822.00 / 1822.00 )² = 1.00000
                                                                                                                          Moon : 1822.00 penalty ratio = (1822.00 / 1737.00 )² = 1.10026
                                                                                                                          Europa : 1822.00 penalty ratio = (1822.00 / 1561.00 )² = 1.36236
                                                                                                                          Triton : 1822.00 penalty ratio = (1822.00 / 1353.00 )² = 1.81343
                                                                                                                          Pluto : 1822.00 penalty ratio = (1822.00 / 1186.00 )² = 2.36008
                                                                                                                          Eris : 1822.00 penalty ratio = (1822.00 / 1163.00 )² = 2.45435
                                                                                                                          Haumea : 911.00 penalty ratio = (911.00 / 816.00 )² = 1.24640
                                                                                                                          Titania : 911.00 penalty ratio = (911.00 / 788.00 )² = 1.33655

                                                                                                                          Max. penalty ratio = 3.70166 for Neptune
                                                                                                                          Score = ceil(152 x 3.70166) = 563






                                                                                                                          share|improve this answer














                                                                                                                          share|improve this answer



                                                                                                                          share|improve this answer








                                                                                                                          edited Dec 12 '18 at 2:50

























                                                                                                                          answered Dec 12 '18 at 2:19









                                                                                                                          TerjerberTerjerber

                                                                                                                          514




                                                                                                                          514












                                                                                                                          • $begingroup$
                                                                                                                            It seems like the optimal multiplier for your current code is $1634$.
                                                                                                                            $endgroup$
                                                                                                                            – Arnauld
                                                                                                                            Dec 12 '18 at 2:36










                                                                                                                          • $begingroup$
                                                                                                                            I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                                                                                                                            $endgroup$
                                                                                                                            – Terjerber
                                                                                                                            Dec 12 '18 at 2:52


















                                                                                                                          • $begingroup$
                                                                                                                            It seems like the optimal multiplier for your current code is $1634$.
                                                                                                                            $endgroup$
                                                                                                                            – Arnauld
                                                                                                                            Dec 12 '18 at 2:36










                                                                                                                          • $begingroup$
                                                                                                                            I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                                                                                                                            $endgroup$
                                                                                                                            – Terjerber
                                                                                                                            Dec 12 '18 at 2:52
















                                                                                                                          $begingroup$
                                                                                                                          It seems like the optimal multiplier for your current code is $1634$.
                                                                                                                          $endgroup$
                                                                                                                          – Arnauld
                                                                                                                          Dec 12 '18 at 2:36




                                                                                                                          $begingroup$
                                                                                                                          It seems like the optimal multiplier for your current code is $1634$.
                                                                                                                          $endgroup$
                                                                                                                          – Arnauld
                                                                                                                          Dec 12 '18 at 2:36












                                                                                                                          $begingroup$
                                                                                                                          I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                                                                                                                          $endgroup$
                                                                                                                          – Terjerber
                                                                                                                          Dec 12 '18 at 2:52




                                                                                                                          $begingroup$
                                                                                                                          I updated it to use half of 1822 (911) instead to I could make a special case for Haumea, so this advice doesn't work anymore. I tried using 817 (half of 1634) but it wasn't good. If you want to work your magic and find the new most optimal number feel free.
                                                                                                                          $endgroup$
                                                                                                                          – Terjerber
                                                                                                                          Dec 12 '18 at 2:52











                                                                                                                          0












                                                                                                                          $begingroup$


                                                                                                                          Python 2, 89 bytes, Score = 234





                                                                                                                          lambda(p):39**4/'zzuSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])**2.18


                                                                                                                          Try it online!



                                                                                                                          Most answers posted appear to have used a "encode/decode" strategy. I wondered how well I could do by estimating the diameter of celestial bodies using a simple equation. It's been a fun exercise, but the moderate byte savings are more than made up for by the accuracy penalty.



                                                                                                                          The core of this solution is the estimating equation:



                                                                                                                          Radius = 39**4/x**2.18


                                                                                                                          where x is twice the rank order of the radius of the body.



                                                                                                                          I generate the value of x based on the input string using a modification of @Erik the Outgolfer's Python 2 solution. I saved a few bytes on his code by recasting my equations to work with [2..40] instead of [1..20].



                                                                                                                          The code for generating rank orders takes up more than 2/3 of the bytes of the whole solution. If anyone has a more compact way of generating ranks, this solution could be shortened further. Because of the accuracy penalty (around 2.6), the score would improve quite a bit.



                                                                                                                          Generating the Equation



                                                                                                                          I used statistical methods to search for simple equations to estimate the size of each body based on its rank. In part following up on the insights in @Level River St's Ruby solution and generalizing, I settled on equations of the form:



                                                                                                                          Radius = A/(Rank)**B


                                                                                                                          Working in R, I used linear models on the log of the radii to develop initial estimates, and then used non-linear optimization, seeding the optimization with the results of the linear models, to search for solutions that minimized the penalty function specified in the problem.



                                                                                                                          The estimated value of A in the above equation is seven digits, so I searched for a simple expression to save a couple of bytes. I looked for expressions of the form



                                                                                                                          x**y


                                                                                                                          for two digit x and 1 digit y (for a total of five bytes, saving two bytes, or about five points, given the penalty) that was not too different from the optimum value of A and did not inflate the penalty much, and ended up with the (otherwise inexplicable):



                                                                                                                          39**4





                                                                                                                          share|improve this answer









                                                                                                                          $endgroup$













                                                                                                                          • $begingroup$
                                                                                                                            The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                                                                                                                            $endgroup$
                                                                                                                            – lirtosiast
                                                                                                                            Dec 12 '18 at 6:15










                                                                                                                          • $begingroup$
                                                                                                                            @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                                                                                                                            $endgroup$
                                                                                                                            – CCB60
                                                                                                                            Dec 12 '18 at 14:13
















                                                                                                                          0












                                                                                                                          $begingroup$


                                                                                                                          Python 2, 89 bytes, Score = 234





                                                                                                                          lambda(p):39**4/'zzuSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])**2.18


                                                                                                                          Try it online!



                                                                                                                          Most answers posted appear to have used a "encode/decode" strategy. I wondered how well I could do by estimating the diameter of celestial bodies using a simple equation. It's been a fun exercise, but the moderate byte savings are more than made up for by the accuracy penalty.



                                                                                                                          The core of this solution is the estimating equation:



                                                                                                                          Radius = 39**4/x**2.18


                                                                                                                          where x is twice the rank order of the radius of the body.



                                                                                                                          I generate the value of x based on the input string using a modification of @Erik the Outgolfer's Python 2 solution. I saved a few bytes on his code by recasting my equations to work with [2..40] instead of [1..20].



                                                                                                                          The code for generating rank orders takes up more than 2/3 of the bytes of the whole solution. If anyone has a more compact way of generating ranks, this solution could be shortened further. Because of the accuracy penalty (around 2.6), the score would improve quite a bit.



                                                                                                                          Generating the Equation



                                                                                                                          I used statistical methods to search for simple equations to estimate the size of each body based on its rank. In part following up on the insights in @Level River St's Ruby solution and generalizing, I settled on equations of the form:



                                                                                                                          Radius = A/(Rank)**B


                                                                                                                          Working in R, I used linear models on the log of the radii to develop initial estimates, and then used non-linear optimization, seeding the optimization with the results of the linear models, to search for solutions that minimized the penalty function specified in the problem.



                                                                                                                          The estimated value of A in the above equation is seven digits, so I searched for a simple expression to save a couple of bytes. I looked for expressions of the form



                                                                                                                          x**y


                                                                                                                          for two digit x and 1 digit y (for a total of five bytes, saving two bytes, or about five points, given the penalty) that was not too different from the optimum value of A and did not inflate the penalty much, and ended up with the (otherwise inexplicable):



                                                                                                                          39**4





                                                                                                                          share|improve this answer









                                                                                                                          $endgroup$













                                                                                                                          • $begingroup$
                                                                                                                            The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                                                                                                                            $endgroup$
                                                                                                                            – lirtosiast
                                                                                                                            Dec 12 '18 at 6:15










                                                                                                                          • $begingroup$
                                                                                                                            @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                                                                                                                            $endgroup$
                                                                                                                            – CCB60
                                                                                                                            Dec 12 '18 at 14:13














                                                                                                                          0












                                                                                                                          0








                                                                                                                          0





                                                                                                                          $begingroup$


                                                                                                                          Python 2, 89 bytes, Score = 234





                                                                                                                          lambda(p):39**4/'zzuSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])**2.18


                                                                                                                          Try it online!



                                                                                                                          Most answers posted appear to have used a "encode/decode" strategy. I wondered how well I could do by estimating the diameter of celestial bodies using a simple equation. It's been a fun exercise, but the moderate byte savings are more than made up for by the accuracy penalty.



                                                                                                                          The core of this solution is the estimating equation:



                                                                                                                          Radius = 39**4/x**2.18


                                                                                                                          where x is twice the rank order of the radius of the body.



                                                                                                                          I generate the value of x based on the input string using a modification of @Erik the Outgolfer's Python 2 solution. I saved a few bytes on his code by recasting my equations to work with [2..40] instead of [1..20].



                                                                                                                          The code for generating rank orders takes up more than 2/3 of the bytes of the whole solution. If anyone has a more compact way of generating ranks, this solution could be shortened further. Because of the accuracy penalty (around 2.6), the score would improve quite a bit.



                                                                                                                          Generating the Equation



                                                                                                                          I used statistical methods to search for simple equations to estimate the size of each body based on its rank. In part following up on the insights in @Level River St's Ruby solution and generalizing, I settled on equations of the form:



                                                                                                                          Radius = A/(Rank)**B


                                                                                                                          Working in R, I used linear models on the log of the radii to develop initial estimates, and then used non-linear optimization, seeding the optimization with the results of the linear models, to search for solutions that minimized the penalty function specified in the problem.



                                                                                                                          The estimated value of A in the above equation is seven digits, so I searched for a simple expression to save a couple of bytes. I looked for expressions of the form



                                                                                                                          x**y


                                                                                                                          for two digit x and 1 digit y (for a total of five bytes, saving two bytes, or about five points, given the penalty) that was not too different from the optimum value of A and did not inflate the penalty much, and ended up with the (otherwise inexplicable):



                                                                                                                          39**4





                                                                                                                          share|improve this answer









                                                                                                                          $endgroup$




                                                                                                                          Python 2, 89 bytes, Score = 234





                                                                                                                          lambda(p):39**4/'zzuSJJaSrUNNrEnVsMeGtTMMoCoInMuErTuPsEaHTT'.find(p[7%len(p)]+p[0])**2.18


                                                                                                                          Try it online!



                                                                                                                          Most answers posted appear to have used a "encode/decode" strategy. I wondered how well I could do by estimating the diameter of celestial bodies using a simple equation. It's been a fun exercise, but the moderate byte savings are more than made up for by the accuracy penalty.



                                                                                                                          The core of this solution is the estimating equation:



                                                                                                                          Radius = 39**4/x**2.18


                                                                                                                          where x is twice the rank order of the radius of the body.



                                                                                                                          I generate the value of x based on the input string using a modification of @Erik the Outgolfer's Python 2 solution. I saved a few bytes on his code by recasting my equations to work with [2..40] instead of [1..20].



                                                                                                                          The code for generating rank orders takes up more than 2/3 of the bytes of the whole solution. If anyone has a more compact way of generating ranks, this solution could be shortened further. Because of the accuracy penalty (around 2.6), the score would improve quite a bit.



                                                                                                                          Generating the Equation



                                                                                                                          I used statistical methods to search for simple equations to estimate the size of each body based on its rank. In part following up on the insights in @Level River St's Ruby solution and generalizing, I settled on equations of the form:



                                                                                                                          Radius = A/(Rank)**B


                                                                                                                          Working in R, I used linear models on the log of the radii to develop initial estimates, and then used non-linear optimization, seeding the optimization with the results of the linear models, to search for solutions that minimized the penalty function specified in the problem.



                                                                                                                          The estimated value of A in the above equation is seven digits, so I searched for a simple expression to save a couple of bytes. I looked for expressions of the form



                                                                                                                          x**y


                                                                                                                          for two digit x and 1 digit y (for a total of five bytes, saving two bytes, or about five points, given the penalty) that was not too different from the optimum value of A and did not inflate the penalty much, and ended up with the (otherwise inexplicable):



                                                                                                                          39**4






                                                                                                                          share|improve this answer












                                                                                                                          share|improve this answer



                                                                                                                          share|improve this answer










                                                                                                                          answered Dec 12 '18 at 5:21









                                                                                                                          CCB60CCB60

                                                                                                                          1595




                                                                                                                          1595












                                                                                                                          • $begingroup$
                                                                                                                            The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                                                                                                                            $endgroup$
                                                                                                                            – lirtosiast
                                                                                                                            Dec 12 '18 at 6:15










                                                                                                                          • $begingroup$
                                                                                                                            @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                                                                                                                            $endgroup$
                                                                                                                            – CCB60
                                                                                                                            Dec 12 '18 at 14:13


















                                                                                                                          • $begingroup$
                                                                                                                            The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                                                                                                                            $endgroup$
                                                                                                                            – lirtosiast
                                                                                                                            Dec 12 '18 at 6:15










                                                                                                                          • $begingroup$
                                                                                                                            @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                                                                                                                            $endgroup$
                                                                                                                            – CCB60
                                                                                                                            Dec 12 '18 at 14:13
















                                                                                                                          $begingroup$
                                                                                                                          The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                                                                                                                          $endgroup$
                                                                                                                          – lirtosiast
                                                                                                                          Dec 12 '18 at 6:15




                                                                                                                          $begingroup$
                                                                                                                          The scoring algorithm really seems to hurt this method-- I'd guess that it would do better under L2 or L1 norm of error. Though you're wasting bytes storing the names anyway.
                                                                                                                          $endgroup$
                                                                                                                          – lirtosiast
                                                                                                                          Dec 12 '18 at 6:15












                                                                                                                          $begingroup$
                                                                                                                          @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                                                                                                                          $endgroup$
                                                                                                                          – CCB60
                                                                                                                          Dec 12 '18 at 14:13




                                                                                                                          $begingroup$
                                                                                                                          @lirtosiast Agree to both points. Interestingly, a least squares fit (L2 norm) is pretty good under this scoring algorithm too. It has only about 5% worse penalty than the best equation I found. On storing the names : I could not figure out a more compact way to generate an ascending sequence of numbers from text input. The modulo arithmetic approaches taken in other answers randomize the order.
                                                                                                                          $endgroup$
                                                                                                                          – CCB60
                                                                                                                          Dec 12 '18 at 14:13


















                                                                                                                          draft saved

                                                                                                                          draft discarded




















































                                                                                                                          If this is an answer to a challenge…




                                                                                                                          • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                                                                                          • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                                                                                            Explanations of your answer make it more interesting to read and are very much encouraged.


                                                                                                                          • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.



                                                                                                                          More generally…




                                                                                                                          • …Please make sure to answer the question and provide sufficient detail.


                                                                                                                          • …Avoid asking for help, clarification or responding to other answers (use comments instead).





                                                                                                                          draft saved


                                                                                                                          draft discarded














                                                                                                                          StackExchange.ready(
                                                                                                                          function () {
                                                                                                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f177021%2fas-we-travel-the-universe%23new-answer', 'question_page');
                                                                                                                          }
                                                                                                                          );

                                                                                                                          Post as a guest















                                                                                                                          Required, but never shown





















































                                                                                                                          Required, but never shown














                                                                                                                          Required, but never shown












                                                                                                                          Required, but never shown







                                                                                                                          Required, but never shown

































                                                                                                                          Required, but never shown














                                                                                                                          Required, but never shown












                                                                                                                          Required, but never shown







                                                                                                                          Required, but never shown







                                                                                                                          Popular posts from this blog

                                                                                                                          Plaza Victoria

                                                                                                                          Puebla de Zaragoza

                                                                                                                          Change location of user folders through cmd or PowerShell?