Skip to main content
Rollback to Revision 20
Source Link

C# (813826)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",tn,kt,v;statick;static void Main(){int n=0;var l=new string[999];foreach(var c ind=new s){n=ArraySystem.IndexOfCollections.Specialized.StringDictionary(l,null);if;while(c<91&&ks!=null=""){ifk=g;d[k]=g;if(k=="1"d[k]=="1")k=l[n-1]d[k]=k.Substring(0,2);if(n%2==0)k=k.ToLower();l[n]=k;k="";}k+=c;;};t=Console.ReadLine().ToLower();while(t!=""&&(n=Array=""&!d.IndexOfContainsKey(l,t))%2!=0)t=t.Remove(t.Length-1);Console.Write(l[n+1]d[t]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

C# (813)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",t,k,v;static void Main(){int n=0;var l=new string[999];foreach(var c in s){n=Array.IndexOf(l,null);if(c<91&&k!=null){if(k=="1")k=l[n-1].Substring(0,2);if(n%2==0)k=k.ToLower();l[n]=k;k="";}k+=c;};t=Console.ReadLine().ToLower();while(t!=""&&(n=Array.IndexOf(l,t))%2!=0)t=t.Remove(t.Length-1);Console.Write(l[n+1]);}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

C# (826)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",n,t,k;static void Main(){var d=new System.Collections.Specialized.StringDictionary();while(s!=""){k=g;d[k]=g;if(d[k]=="1")d[k]=k.Substring(0,2);};t=Console.ReadLine();while(t!=""&!d.ContainsKey(t))t=t.Remove(t.Length-1);Console.Write(d[t]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

deleted 11 characters in body
Source Link

C# (826813)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",n,t,k;statick,v;static void Main(){int n=0;var l=new string[999];foreach(var d=newc System.Collections.Specializedin s){n=Array.StringDictionaryIndexOf(l,null);while;if(sc<91&&k!=""=null){k=g;d[k]=g;ifif(d[k]=="1"k=="1")d[k]=kk=l[n-1].Substring(0,2);;if(n%2==0)k=k.ToLower();l[n]=k;k="";}k+=c;};t=Console.ReadLine().ToLower();while(t!=""&!d=""&&(n=Array.ContainsKeyIndexOf(l,t))%2!=0)t=t.Remove(t.Length-1);Console.Write(d[t]l[n+1]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

C# (826)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",n,t,k;static void Main(){var d=new System.Collections.Specialized.StringDictionary();while(s!=""){k=g;d[k]=g;if(d[k]=="1")d[k]=k.Substring(0,2);};t=Console.ReadLine();while(t!=""&!d.ContainsKey(t))t=t.Remove(t.Length-1);Console.Write(d[t]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

C# (813)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",t,k,v;static void Main(){int n=0;var l=new string[999];foreach(var c in s){n=Array.IndexOf(l,null);if(c<91&&k!=null){if(k=="1")k=l[n-1].Substring(0,2);if(n%2==0)k=k.ToLower();l[n]=k;k="";}k+=c;};t=Console.ReadLine().ToLower();while(t!=""&&(n=Array.IndexOf(l,t))%2!=0)t=t.Remove(t.Length-1);Console.Write(l[n+1]);}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

deleted 7 characters in body
Source Link

C# (833826)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",n,t,k;static void Main(){int i=0;varvar d=new System.Collections.Specialized.StringDictionary();while(s!=""){k=g;d[k]=g;if((i=k[0]-48)<9d[k]=="1")d[k]=k.RemoveSubstring(i0,2);};t=Console.ReadLine();while(t!=""&!d.ContainsKey(t))t=t.Remove(t.Length-1);Console.Write(d[t]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

C# (833)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",n,t,k;static void Main(){int i=0;var d=new System.Collections.Specialized.StringDictionary();while(s!=""){k=g;d[k]=g;if((i=k[0]-48)<9)d[k]=k.Remove(i);};t=Console.ReadLine();while(t!=""&!d.ContainsKey(t))t=t.Remove(t.Length-1);Console.Write(d[t]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

C# (826)

not the greatest but I thought I'd try it with the handicap of c#.

using System;class P{static string s="HyHHe1Li1Be1BoBCaCNitNOxOFlFNe1SoNaMaMgAl1Sil1PhPSuSChClAr1PotKCal1Sc1Tit1VaVChrCrManMnIrFeCo1Ni1CopCuZiZnGa1Ge1ArsAsSe1Br1Kr1RuRbStSrYtYZirZrNioNbMo1TecTcRut1Rh1PaPdSiAgCadCdIn1TiSnAnSbTel1IoIXe1CaeCsBa1La1Ce1Pra1NeoNdPrPmSaSmEu1GadGdTeTbDy1Ho1Er1ThTmYttYbLu1HaHfTa1TuWRheReOs1Iri1PlPtGoAuMeHgThaTlLePbBi1Po1AsAtRaRnFr1Rad1Ac1Tho1ProPaUrUNepNpPluPuAm1CuCmBerBkCaliCfEiEsFeFmMenMdNo1LawLrRuthRfDuDbSeaSgBohBhHasHsMeiMtDaDsRoRgCopeCnUnUutFle1UnuUupLivLvUnunUus",n,t,k;static void Main(){var d=new System.Collections.Specialized.StringDictionary();while(s!=""){k=g;d[k]=g;if(d[k]=="1")d[k]=k.Substring(0,2);};t=Console.ReadLine();while(t!=""&!d.ContainsKey(t))t=t.Remove(t.Length-1);Console.Write(d[t]);}static string g{get{n="";do n+=s[0];while((s=s.Remove(0,1))!=""&&s[0]>96);return n;}}}

So I wrote a program to turn the full name of elements (e.g. carbon) in to the smallest but still unique string possible and did this for all elements with respect to all the other unique strings. I then serialized that in to a big ugly string where capital letters denote the start of "chunks", with chunks alternating between being keys and values. Like KeyValueKey2Value2 etc.

This script desterilizes that big string and cuts a character off the end of the inputted string until it finds it in the dictionary made from the big string.

(I should add my knowledge of C# isn't amazing and the original submission I made was just using things I knew but I've subsequently had some tricks pointed out to me by others.)

deleted 1 character in body
Source Link
Loading
deleted 4 characters in body
Source Link
Loading
deleted 1 character in body
Source Link
Loading
deleted 12 characters in body
Source Link
Loading
deleted 3 characters in body
Source Link
Loading
added 1 character in body
Source Link
Loading
deleted 11 characters in body
Source Link
Loading
improved golf answer by applying standard golf tricks / logic inversions
Source Link
Loading
deleted 9 characters in body
Source Link
Loading
deleted 57 characters in body
Source Link
Loading
added 66 characters in body
Source Link
Loading
deleted 11 characters in body; added 182 characters in body
Source Link
Loading
deleted 11 characters in body
Source Link
Loading
deleted 5 characters in body; deleted 55 characters in body
Source Link
Loading
deleted 8 characters in body
Source Link
Loading
deleted 1 character in body
Source Link
Loading
deleted 6 characters in body
Source Link
Loading
deleted 6 characters in body
Source Link
Loading
Source Link
Loading