9
2
We all have knowledge of the periodic table, since our days in school. Something most of us have often tried to do is to spell out your name using elements of the table.
Your challenge is to do exactly this.
You will be given a string to STDIN or equivalent, and you will need to output the formula corresponding to the name, in the form <formula> : <Elements names spelled out>
In case nothing corresponds print: :(
Use this list for element names: List of elements
This is code-golf, so the shortest answer wins.
Standard loopholes rules apply
Examples
Input: Smith
Output: Sm I Th : Samarium Iodine Thorium
Input: Oscar Kou
Output: Os C Ar K O U : Osmium Carbon Argon Potassium Oxygen Uranium
Input: Giacomo Fenzi
Output::(
Clarifications
There may be occurrences of the input being divisible in two or more ways, in this case choose the output with the least number of elements in. If even this case brings to ambiguity you are free to choose which output to print.
You may expect an input consisting of only letters and spaces, no numbers nor other characters used. Spaces in the input should be ignored, and do not change or "split" it.
Please format your answer in the following way:
Language, Number of Bytes, Number of Bytes excluding the bytes to store the elements
EDIT
I think this question is fundamentally different from this one, since it asks to find the elements that compose a word and additionally requires to write their full names out, instead of finding the set of words spellable with the periodic table
only letters
, and, well, spaces. I guess. – mınxomaτ – 2015-09-22T16:58:12.287What should output be for
A L
? – lirtosiast – 2015-09-22T17:00:38.897@minxomat yes of course :) – WizardOfMenlo – 2015-09-22T17:07:16.743
7
Geobits
-->:(
– Geobits – 2015-09-22T17:09:22.6533Could you provide a periodic table / list of elements and names for everyone to use? – Loovjo – 2015-09-22T17:10:21.370
@Loovjo of course, I'll do it – WizardOfMenlo – 2015-09-22T17:11:04.143
@ThomasKwa it will output Al : Alluminium – WizardOfMenlo – 2015-09-22T17:12:01.313
@WizardOfMenlo Not "Aluminium" or "Aluminum"? See here.
– mbomb007 – 2015-09-22T17:17:24.143@mbomb007 I'll put a list with the correct spellings, the one above is just what my phone said :) – WizardOfMenlo – 2015-09-22T17:19:57.003
@WizardOfMenlo It shouldn't have 2
l
s. That's an incorrect spelling. Use a dictionary, not your phone. – mbomb007 – 2015-09-22T17:24:13.6101Does the periodic table data need to be included in the code count? – alexanderbird – 2015-09-22T17:27:26.250
@alexanderbird I think it would be better, it would be great if you could add the score with and without the data close to your anwer – WizardOfMenlo – 2015-09-22T17:31:40.400
Which one determines the winner? – lirtosiast – 2015-09-22T19:30:24.447
@ThomasKwa I think the total one – WizardOfMenlo – 2015-09-22T19:37:54.807