Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#SmileBASIC, (削除) 1763 (削除ここまで)(削除) 1418 (削除ここまで)(削除) 1204 (削除ここまで) 1128 bytes

SmileBASIC, (削除) 1763 (削除ここまで)(削除) 1418 (削除ここまで)(削除) 1204 (削除ここまで) 1128 bytes

INPUT E$Hro$="H
Hiu$="He
Lhi$="Li
Byl$="Be
Bon$="B
Cbo$="C
Nro$="N
Oge$="O
For$="F
Nn$="Ne
Siu$="Na
Mne$="Mg
Ami$="Al
Sic$="Si
Psp$="P
Sfu$="S
Cor$="Cl
Aon$="Ar
Pas$="K
Cci$="Ca
Snd$="Sc
Tan$="Ti
Vad$="V
Com$="Cr
Mga$="Mn
In$="Fe
Cal$="Co
Nke$="Ni
Cpe$="Cu
Zc$="Zn
Gli$="Ga
Gma$="Ge
Aen$="As
Sen$="Se
Bmi$="Br
Kpt$="Kr
Rid$="Rb
Son$="Sr
Yri$="Y
Zco$="Zr
Nbi$="Nb
Myb$="Mo
Thn$="Tc
Rhe$="Ru
Rdi$="Rh
Pla$="Pd
Sve$="Ag
Cmi$="Cd
Iiu$="In
T$="Sn
Aim$="Sb
Tlu$="Te
Iin$="I
Xon$="Xe
Csi$="Cs
Biu$="Ba
Lth$="La
Pse$="Pr
Ndy$="Nd
Pme$="Pm
Sar$="Sm
Eop$="Eu
Gol$="Gd
Tbi$="Tb
Dpr$="Dy
Hmi$="Ho
Eiu$="Er
Tli$="Tm
Yer$="Yb
Let$="Lu
Hni$="Hf
Tta$="Ta
Tgs$="W
Rni$="Re
Oiu$="Os
Idi$="Ir
Pti$="Pt
Gd$="Au
Mcu$="Hg
Tll$="Tl
Ld$="Pb
Bmu$="Bi
Pon$="Po
Aat$="At
Ron$="Rn
Fnc$="Fr
Riu$="Ra
Ain$="Ac
Tri$="Th
Pta$="Pa
Uni$="U
Ntu$="Np
Pto$="Pu
Ari$="Am
Ciu$="Cm
Bke$="Bk
Cif$="Cf
Est$="Es
Fmi$="Fm
Mde$="Md
Nel$="No
Lre$="Lr
Dni$="Db
Sbo$="Sg
Bri$="Bh
Hsi$="Hs
Mtn$="Mt
Dms$="Ds
Rnt$="Rg
Cer$="Cn
Unt$="Uut
Fro$="Fl
Unp$="Uup
Ler$="Lv
Uns$="Uus
Uno$="Uuo
S$=VAR(E$[0]+MID$(E,3,2ドル))IF"Cm"==S$*!VAL(".1"+E$[1])THEN S$="Ce
IF LEN(E$)>12THEN S$="Rf
?S$

I chose 3 characters which were mostly unique (the 0th, 2nd, and 3rd), which leaves 2 special cases: Cerium/Curium are both "Ciu", and Ruthenium/Rutherfordium are both "Rhe". For Ciu, I check if the second character of the name is "e" or "E", and for "Rhe", I check the length of the name.

VAR(name) returns the variable with that name. Variable names are case insensitive.

#SmileBASIC, (削除) 1763 (削除ここまで)(削除) 1418 (削除ここまで)(削除) 1204 (削除ここまで) 1128 bytes

INPUT E$Hro$="H
Hiu$="He
Lhi$="Li
Byl$="Be
Bon$="B
Cbo$="C
Nro$="N
Oge$="O
For$="F
Nn$="Ne
Siu$="Na
Mne$="Mg
Ami$="Al
Sic$="Si
Psp$="P
Sfu$="S
Cor$="Cl
Aon$="Ar
Pas$="K
Cci$="Ca
Snd$="Sc
Tan$="Ti
Vad$="V
Com$="Cr
Mga$="Mn
In$="Fe
Cal$="Co
Nke$="Ni
Cpe$="Cu
Zc$="Zn
Gli$="Ga
Gma$="Ge
Aen$="As
Sen$="Se
Bmi$="Br
Kpt$="Kr
Rid$="Rb
Son$="Sr
Yri$="Y
Zco$="Zr
Nbi$="Nb
Myb$="Mo
Thn$="Tc
Rhe$="Ru
Rdi$="Rh
Pla$="Pd
Sve$="Ag
Cmi$="Cd
Iiu$="In
T$="Sn
Aim$="Sb
Tlu$="Te
Iin$="I
Xon$="Xe
Csi$="Cs
Biu$="Ba
Lth$="La
Pse$="Pr
Ndy$="Nd
Pme$="Pm
Sar$="Sm
Eop$="Eu
Gol$="Gd
Tbi$="Tb
Dpr$="Dy
Hmi$="Ho
Eiu$="Er
Tli$="Tm
Yer$="Yb
Let$="Lu
Hni$="Hf
Tta$="Ta
Tgs$="W
Rni$="Re
Oiu$="Os
Idi$="Ir
Pti$="Pt
Gd$="Au
Mcu$="Hg
Tll$="Tl
Ld$="Pb
Bmu$="Bi
Pon$="Po
Aat$="At
Ron$="Rn
Fnc$="Fr
Riu$="Ra
Ain$="Ac
Tri$="Th
Pta$="Pa
Uni$="U
Ntu$="Np
Pto$="Pu
Ari$="Am
Ciu$="Cm
Bke$="Bk
Cif$="Cf
Est$="Es
Fmi$="Fm
Mde$="Md
Nel$="No
Lre$="Lr
Dni$="Db
Sbo$="Sg
Bri$="Bh
Hsi$="Hs
Mtn$="Mt
Dms$="Ds
Rnt$="Rg
Cer$="Cn
Unt$="Uut
Fro$="Fl
Unp$="Uup
Ler$="Lv
Uns$="Uus
Uno$="Uuo
S$=VAR(E$[0]+MID$(E,3,2ドル))IF"Cm"==S$*!VAL(".1"+E$[1])THEN S$="Ce
IF LEN(E$)>12THEN S$="Rf
?S$

I chose 3 characters which were mostly unique (the 0th, 2nd, and 3rd), which leaves 2 special cases: Cerium/Curium are both "Ciu", and Ruthenium/Rutherfordium are both "Rhe". For Ciu, I check if the second character of the name is "e" or "E", and for "Rhe", I check the length of the name.

VAR(name) returns the variable with that name. Variable names are case insensitive.

SmileBASIC, (削除) 1763 (削除ここまで)(削除) 1418 (削除ここまで)(削除) 1204 (削除ここまで) 1128 bytes

INPUT E$Hro$="H
Hiu$="He
Lhi$="Li
Byl$="Be
Bon$="B
Cbo$="C
Nro$="N
Oge$="O
For$="F
Nn$="Ne
Siu$="Na
Mne$="Mg
Ami$="Al
Sic$="Si
Psp$="P
Sfu$="S
Cor$="Cl
Aon$="Ar
Pas$="K
Cci$="Ca
Snd$="Sc
Tan$="Ti
Vad$="V
Com$="Cr
Mga$="Mn
In$="Fe
Cal$="Co
Nke$="Ni
Cpe$="Cu
Zc$="Zn
Gli$="Ga
Gma$="Ge
Aen$="As
Sen$="Se
Bmi$="Br
Kpt$="Kr
Rid$="Rb
Son$="Sr
Yri$="Y
Zco$="Zr
Nbi$="Nb
Myb$="Mo
Thn$="Tc
Rhe$="Ru
Rdi$="Rh
Pla$="Pd
Sve$="Ag
Cmi$="Cd
Iiu$="In
T$="Sn
Aim$="Sb
Tlu$="Te
Iin$="I
Xon$="Xe
Csi$="Cs
Biu$="Ba
Lth$="La
Pse$="Pr
Ndy$="Nd
Pme$="Pm
Sar$="Sm
Eop$="Eu
Gol$="Gd
Tbi$="Tb
Dpr$="Dy
Hmi$="Ho
Eiu$="Er
Tli$="Tm
Yer$="Yb
Let$="Lu
Hni$="Hf
Tta$="Ta
Tgs$="W
Rni$="Re
Oiu$="Os
Idi$="Ir
Pti$="Pt
Gd$="Au
Mcu$="Hg
Tll$="Tl
Ld$="Pb
Bmu$="Bi
Pon$="Po
Aat$="At
Ron$="Rn
Fnc$="Fr
Riu$="Ra
Ain$="Ac
Tri$="Th
Pta$="Pa
Uni$="U
Ntu$="Np
Pto$="Pu
Ari$="Am
Ciu$="Cm
Bke$="Bk
Cif$="Cf
Est$="Es
Fmi$="Fm
Mde$="Md
Nel$="No
Lre$="Lr
Dni$="Db
Sbo$="Sg
Bri$="Bh
Hsi$="Hs
Mtn$="Mt
Dms$="Ds
Rnt$="Rg
Cer$="Cn
Unt$="Uut
Fro$="Fl
Unp$="Uup
Ler$="Lv
Uns$="Uus
Uno$="Uuo
S$=VAR(E$[0]+MID$(E,3,2ドル))IF"Cm"==S$*!VAL(".1"+E$[1])THEN S$="Ce
IF LEN(E$)>12THEN S$="Rf
?S$

I chose 3 characters which were mostly unique (the 0th, 2nd, and 3rd), which leaves 2 special cases: Cerium/Curium are both "Ciu", and Ruthenium/Rutherfordium are both "Rhe". For Ciu, I check if the second character of the name is "e" or "E", and for "Rhe", I check the length of the name.

VAR(name) returns the variable with that name. Variable names are case insensitive.

added 13 characters in body
Source Link
12Me21
  • 6.8k
  • 1
  • 23
  • 40

#SmileBASIC, (削除) 1763 (削除ここまで) (削除) 1418 (削除ここまで) 1204(削除) 1204 (削除ここまで) 1128 bytes

INPUT E$YDRO$="H
ELIU$="He
ITHI$="LiE$Hro$="H
ERYL$="BeHiu$="He
ORON$="BLhi$="Li
ARBO$="CByl$="Be
ITRO$="NBon$="B
XYGE$="OCbo$="C
LUOR$="FNro$="N
EON$="NeOge$="O
ODIU$="NaFor$="F
AGNE$="MgNn$="Ne
LUMI$="AlSiu$="Na
ILIC$="SiMne$="Mg
HOSP$="PAmi$="Al
ULFU$="SSic$="Si
HLOR$="ClPsp$="P
RGON$="ArSfu$="S
OTAS$="KCor$="Cl
ALCI$="CaAon$="Ar
CAND$="ScPas$="K
ITAN$="TiCci$="Ca
ANAD$="VSnd$="Sc
HROM$="CrTan$="Ti
ANGA$="MnVad$="V
RON$="FeCom$="Cr
OBAL$="CoMga$="Mn
ICKE$="NiIn$="Fe
OPPE$="CuCal$="Co
INC$="ZnNke$="Ni
ALLI$="GaCpe$="Cu
ERMA$="GeZc$="Zn
RSEN$="AsGli$="Ga
ELEN$="SeGma$="Ge
ROMI$="BrAen$="As
RYPT$="KrSen$="Se
UBID$="RbBmi$="Br
TRON$="SrKpt$="Kr
TTRI$="YRid$="Rb
IRCO$="ZrSon$="Sr
IOBI$="NbYri$="Y
OLYB$="MoZco$="Zr
ECHN$="TcNbi$="Nb
UTHE$="RuMyb$="Mo
HODI$="RhThn$="Tc
ALLA$="PdRhe$="Ru
ILVE$="AgRdi$="Rh
ADMI$="CdPla$="Pd
NDIU$="InSve$="Ag
IN$="SnCmi$="Cd
NTIM$="SbIiu$="In
ELLU$="TeT$="Sn
ODIN$="IAim$="Sb
ENON$="XeTlu$="Te
AESI$="CsIin$="I
ARIU$="BaXon$="Xe
ANTH$="LaCsi$="Cs
ERIU$="CeBiu$="Ba
RASE$="PrLth$="La
EODY$="NdPse$="Pr
ROME$="PmNdy$="Nd
AMAR$="SmPme$="Pm
UROP$="EuSar$="Sm
ADOL$="GdEop$="Eu
ERBI$="TbGol$="Gd
YSPR$="DyTbi$="Tb
OLMI$="HoDpr$="Dy
RBIU$="ErHmi$="Ho
HULI$="TmEiu$="Er
TTER$="YbTli$="Tm
UTET$="LuYer$="Yb
AFNI$="HfLet$="Lu
ANTA$="TaHni$="Hf
UNGS$="WTta$="Ta
HENI$="ReTgs$="W
SMIU$="OsRni$="Re
RIDI$="IrOiu$="Os
LATI$="PtIdi$="Ir
OLD$="AuPti$="Pt
ERCU$="HgGd$="Au
HALL$="TlMcu$="Hg
EAD$="PbTll$="Tl
ISMU$="BiLd$="Pb
OLON$="PoBmu$="Bi
STAT$="AtPon$="Po
ADON$="RnAat$="At
RANC$="FrRon$="Rn
ADIU$="RaFnc$="Fr
CTIN$="AcRiu$="Ra
HORI$="ThAin$="Ac
ROTA$="PaTri$="Th
RANI$="UPta$="Pa
EPTU$="NpUni$="U
LUTO$="PuNtu$="Np
MERI$="AmPto$="Pu
URIU$="CmAri$="Am
ERKE$="BkCiu$="Cm
ALIF$="CfBke$="Bk
INST$="EsCif$="Cf
ERMI$="FmEst$="Es
ENDE$="MdFmi$="Fm
OBEL$="NoMde$="Md
AWRE$="LrNel$="No
RUTH$="RfLre$="Lr
UBNI$="DbDni$="Db
EABO$="SgSbo$="Sg
OHRI$="BhBri$="Bh
ASSI$="HsHsi$="Hs
EITN$="MtMtn$="Mt
ARMS$="DsDms$="Ds
OENT$="RgRnt$="Rg
OPER$="CnCer$="Cn
NUNT$="UutUnt$="Uut
LERO$="FlFro$="Fl
NUNP$="UupUnp$="Uup
IVER$="LvLer$="Lv
NUNS$="UusUns$="Uus
NUNO$="UuoUno$="Uuo
E$=VARS$=VAR(MID$E$[0]+MID$(E$,3,2))IF"Cm"==S$*!VAL(".1"+E$[1])THEN S$="Ce
IF LEN(E$)<13,4)+"$")>12THEN S$="Rf
?S$

The substring of length 4I chose 3 characters which were mostly unique (the 0th, starting at index 12nd, is unique for all element namesand 3rd), except Rutherfordiumwhich leaves 2 special cases: Cerium/Curium are both "Ciu", and Ruthenium/Rutherfordium are both "Rhe". Rutherfordium is handled as a special caseFor Ciu, by checkingI check if the second character of the name is 13 characters"e" or longer"E", and for "Rhe", I check the length of the name.

VAR(name) returns the variable with that name. Variable names are case insensitive.

#SmileBASIC, (削除) 1763 (削除ここまで) (削除) 1418 (削除ここまで) 1204 bytes

INPUT E$YDRO$="H
ELIU$="He
ITHI$="Li
ERYL$="Be
ORON$="B
ARBO$="C
ITRO$="N
XYGE$="O
LUOR$="F
EON$="Ne
ODIU$="Na
AGNE$="Mg
LUMI$="Al
ILIC$="Si
HOSP$="P
ULFU$="S
HLOR$="Cl
RGON$="Ar
OTAS$="K
ALCI$="Ca
CAND$="Sc
ITAN$="Ti
ANAD$="V
HROM$="Cr
ANGA$="Mn
RON$="Fe
OBAL$="Co
ICKE$="Ni
OPPE$="Cu
INC$="Zn
ALLI$="Ga
ERMA$="Ge
RSEN$="As
ELEN$="Se
ROMI$="Br
RYPT$="Kr
UBID$="Rb
TRON$="Sr
TTRI$="Y
IRCO$="Zr
IOBI$="Nb
OLYB$="Mo
ECHN$="Tc
UTHE$="Ru
HODI$="Rh
ALLA$="Pd
ILVE$="Ag
ADMI$="Cd
NDIU$="In
IN$="Sn
NTIM$="Sb
ELLU$="Te
ODIN$="I
ENON$="Xe
AESI$="Cs
ARIU$="Ba
ANTH$="La
ERIU$="Ce
RASE$="Pr
EODY$="Nd
ROME$="Pm
AMAR$="Sm
UROP$="Eu
ADOL$="Gd
ERBI$="Tb
YSPR$="Dy
OLMI$="Ho
RBIU$="Er
HULI$="Tm
TTER$="Yb
UTET$="Lu
AFNI$="Hf
ANTA$="Ta
UNGS$="W
HENI$="Re
SMIU$="Os
RIDI$="Ir
LATI$="Pt
OLD$="Au
ERCU$="Hg
HALL$="Tl
EAD$="Pb
ISMU$="Bi
OLON$="Po
STAT$="At
ADON$="Rn
RANC$="Fr
ADIU$="Ra
CTIN$="Ac
HORI$="Th
ROTA$="Pa
RANI$="U
EPTU$="Np
LUTO$="Pu
MERI$="Am
URIU$="Cm
ERKE$="Bk
ALIF$="Cf
INST$="Es
ERMI$="Fm
ENDE$="Md
OBEL$="No
AWRE$="Lr
RUTH$="Rf
UBNI$="Db
EABO$="Sg
OHRI$="Bh
ASSI$="Hs
EITN$="Mt
ARMS$="Ds
OENT$="Rg
OPER$="Cn
NUNT$="Uut
LERO$="Fl
NUNP$="Uup
IVER$="Lv
NUNS$="Uus
NUNO$="Uuo
E$=VAR(MID$(E,ドルLEN(E$)<13,4)+"$")

The substring of length 4, starting at index 1, is unique for all element names, except Rutherfordium and Ruthenium. Rutherfordium is handled as a special case, by checking if the name is 13 characters or longer.

VAR(name) returns the variable with that name. Variable names are case insensitive.

#SmileBASIC, (削除) 1763 (削除ここまで) (削除) 1418 (削除ここまで) (削除) 1204 (削除ここまで) 1128 bytes

INPUT E$Hro$="H
Hiu$="He
Lhi$="Li
Byl$="Be
Bon$="B
Cbo$="C
Nro$="N
Oge$="O
For$="F
Nn$="Ne
Siu$="Na
Mne$="Mg
Ami$="Al
Sic$="Si
Psp$="P
Sfu$="S
Cor$="Cl
Aon$="Ar
Pas$="K
Cci$="Ca
Snd$="Sc
Tan$="Ti
Vad$="V
Com$="Cr
Mga$="Mn
In$="Fe
Cal$="Co
Nke$="Ni
Cpe$="Cu
Zc$="Zn
Gli$="Ga
Gma$="Ge
Aen$="As
Sen$="Se
Bmi$="Br
Kpt$="Kr
Rid$="Rb
Son$="Sr
Yri$="Y
Zco$="Zr
Nbi$="Nb
Myb$="Mo
Thn$="Tc
Rhe$="Ru
Rdi$="Rh
Pla$="Pd
Sve$="Ag
Cmi$="Cd
Iiu$="In
T$="Sn
Aim$="Sb
Tlu$="Te
Iin$="I
Xon$="Xe
Csi$="Cs
Biu$="Ba
Lth$="La
Pse$="Pr
Ndy$="Nd
Pme$="Pm
Sar$="Sm
Eop$="Eu
Gol$="Gd
Tbi$="Tb
Dpr$="Dy
Hmi$="Ho
Eiu$="Er
Tli$="Tm
Yer$="Yb
Let$="Lu
Hni$="Hf
Tta$="Ta
Tgs$="W
Rni$="Re
Oiu$="Os
Idi$="Ir
Pti$="Pt
Gd$="Au
Mcu$="Hg
Tll$="Tl
Ld$="Pb
Bmu$="Bi
Pon$="Po
Aat$="At
Ron$="Rn
Fnc$="Fr
Riu$="Ra
Ain$="Ac
Tri$="Th
Pta$="Pa
Uni$="U
Ntu$="Np
Pto$="Pu
Ari$="Am
Ciu$="Cm
Bke$="Bk
Cif$="Cf
Est$="Es
Fmi$="Fm
Mde$="Md
Nel$="No
Lre$="Lr
Dni$="Db
Sbo$="Sg
Bri$="Bh
Hsi$="Hs
Mtn$="Mt
Dms$="Ds
Rnt$="Rg
Cer$="Cn
Unt$="Uut
Fro$="Fl
Unp$="Uup
Ler$="Lv
Uns$="Uus
Uno$="Uuo
S$=VAR(E$[0]+MID$(E$,3,2))IF"Cm"==S$*!VAL(".1"+E$[1])THEN S$="Ce
IF LEN(E$)>12THEN S$="Rf
?S$

I chose 3 characters which were mostly unique (the 0th, 2nd, and 3rd), which leaves 2 special cases: Cerium/Curium are both "Ciu", and Ruthenium/Rutherfordium are both "Rhe". For Ciu, I check if the second character of the name is "e" or "E", and for "Rhe", I check the length of the name.

VAR(name) returns the variable with that name. Variable names are case insensitive.

deleted 35 characters in body
Source Link
12Me21
  • 6.8k
  • 1
  • 23
  • 40

#SmileBASIC, (削除) 1763 (削除ここまで) 1418(削除) 1418 (削除ここまで) 1204 bytes INPUT E$Hydrog$="H Helium$="He Lithiu$="Li Beryll$="Be Boron$="B Carbon$="C Nitrog$="N Oxygen$="O Fluori$="F Neon$="Ne Sodium$="Na Magnes$="Mg Alumin$="Al Silico$="Si Phosph$="P Sulfur$="S Chlori$="Cl Argon$="Ar Potass$="K Calciu$="Ca Scandi$="Sc Titani$="Ti Vanadi$="V Chromi$="Cr Mangan$="Mn Iron$="Fe Cobalt$="Co Nickel$="Ni Copper$="Cu Zinc$="Zn Galliu$="Ga German$="Ge Arseni$="As Seleni$="Se Bromin$="Br Krypto$="Kr Rubidi$="Rb Stront$="Sr Yttriu$="Y Zircon$="Zr Niobiu$="Nb Molybd$="Mo Techne$="Tc Ruthen$="Ru Rhodiu$="Rh Pallad$="Pd Silver$="Ag Cadmiu$="Cd Indium$="In Tin$="Sn Antimo$="Sb Tellur$="Te Iodine$="I Xenon$="Xe Caesiu$="Cs Barium$="Ba Lantha$="La Cerium$="Ce Praseo$="Pr Neodym$="Nd Promet$="Pm Samari$="Sm Europi$="Eu Gadoli$="Gd Terbiu$="Tb Dyspro$="Dy Holmiu$="Ho Erbium$="Er Thuliu$="Tm Ytterb$="Yb Luteti$="Lu Hafniu$="Hf Tantal$="Ta Tungst$="W Rheniu$="Re Osmium$="Os Iridiu$="Ir Platin$="Pt Gold$="Au Mercur$="Hg Thalli$="Tl Lead$="Pb Bismut$="Bi Poloni$="Po Astati$="At Radon$="Rn Franci$="Fr Radium$="Ra Actini$="Ac Thoriu$="Th Protac$="Pa Uraniu$="U Neptun$="Np Pluton$="Pu Americ$="Am Curium$="Cm Berkel$="Bk Califo$="Cf Einste$="Es Fermiu$="Fm Mendel$="Md Nobeli$="No Lawren$="Lr Ruther$="Rf Dubniu$="Db Seabor$="Sg Bohriu$="Bh Hassiu$="Hs Meitne$="Mt Darmst$="Ds Roentg$="Rg Copern$="Cn Ununtr$="Uut Flerov$="Fl Ununpe$="Uup Liverm$="Lv Ununse$="Uus Ununoc$="Uuo ?VAR(LEFT$(E,6ドル)+"$")

INPUT E$YDRO$="H
ELIU$="He
ITHI$="Li
ERYL$="Be
ORON$="B
ARBO$="C
ITRO$="N
XYGE$="O
LUOR$="F
EON$="Ne
ODIU$="Na
AGNE$="Mg
LUMI$="Al
ILIC$="Si
HOSP$="P
ULFU$="S
HLOR$="Cl
RGON$="Ar
OTAS$="K
ALCI$="Ca
CAND$="Sc
ITAN$="Ti
ANAD$="V
HROM$="Cr
ANGA$="Mn
RON$="Fe
OBAL$="Co
ICKE$="Ni
OPPE$="Cu
INC$="Zn
ALLI$="Ga
ERMA$="Ge
RSEN$="As
ELEN$="Se
ROMI$="Br
RYPT$="Kr
UBID$="Rb
TRON$="Sr
TTRI$="Y
IRCO$="Zr
IOBI$="Nb
OLYB$="Mo
ECHN$="Tc
UTHE$="Ru
HODI$="Rh
ALLA$="Pd
ILVE$="Ag
ADMI$="Cd
NDIU$="In
IN$="Sn
NTIM$="Sb
ELLU$="Te
ODIN$="I
ENON$="Xe
AESI$="Cs
ARIU$="Ba
ANTH$="La
ERIU$="Ce
RASE$="Pr
EODY$="Nd
ROME$="Pm
AMAR$="Sm
UROP$="Eu
ADOL$="Gd
ERBI$="Tb
YSPR$="Dy
OLMI$="Ho
RBIU$="Er
HULI$="Tm
TTER$="Yb
UTET$="Lu
AFNI$="Hf
ANTA$="Ta
UNGS$="W
HENI$="Re
SMIU$="Os
RIDI$="Ir
LATI$="Pt
OLD$="Au
ERCU$="Hg
HALL$="Tl
EAD$="Pb
ISMU$="Bi
OLON$="Po
STAT$="At
ADON$="Rn
RANC$="Fr
ADIU$="Ra
CTIN$="Ac
HORI$="Th
ROTA$="Pa
RANI$="U
EPTU$="Np
LUTO$="Pu
MERI$="Am
URIU$="Cm
ERKE$="Bk
ALIF$="Cf
INST$="Es
ERMI$="Fm
ENDE$="Md
OBEL$="No
AWRE$="Lr
RUTH$="Rf
UBNI$="Db
EABO$="Sg
OHRI$="Bh
ASSI$="Hs
EITN$="Mt
ARMS$="Ds
OENT$="Rg
OPER$="Cn
NUNT$="Uut
LERO$="Fl
NUNP$="Uup
IVER$="Lv
NUNS$="Uus
NUNO$="Uuo
E$=VAR(MID$(E,ドルLEN(E$)<13,4)+"$")

The first 6 characterssubstring of each name arelength 4, starting at index 1, is unique for all element names, except Rutherfordium and Ruthenium. Rutherfordium is handled as a special case, by checking if the name is 13 characters or longer.

VAR(name) returns the variable with that name. Variable names are case insensitive.

#SmileBASIC, (削除) 1763 (削除ここまで) 1418 bytes INPUT E$Hydrog$="H Helium$="He Lithiu$="Li Beryll$="Be Boron$="B Carbon$="C Nitrog$="N Oxygen$="O Fluori$="F Neon$="Ne Sodium$="Na Magnes$="Mg Alumin$="Al Silico$="Si Phosph$="P Sulfur$="S Chlori$="Cl Argon$="Ar Potass$="K Calciu$="Ca Scandi$="Sc Titani$="Ti Vanadi$="V Chromi$="Cr Mangan$="Mn Iron$="Fe Cobalt$="Co Nickel$="Ni Copper$="Cu Zinc$="Zn Galliu$="Ga German$="Ge Arseni$="As Seleni$="Se Bromin$="Br Krypto$="Kr Rubidi$="Rb Stront$="Sr Yttriu$="Y Zircon$="Zr Niobiu$="Nb Molybd$="Mo Techne$="Tc Ruthen$="Ru Rhodiu$="Rh Pallad$="Pd Silver$="Ag Cadmiu$="Cd Indium$="In Tin$="Sn Antimo$="Sb Tellur$="Te Iodine$="I Xenon$="Xe Caesiu$="Cs Barium$="Ba Lantha$="La Cerium$="Ce Praseo$="Pr Neodym$="Nd Promet$="Pm Samari$="Sm Europi$="Eu Gadoli$="Gd Terbiu$="Tb Dyspro$="Dy Holmiu$="Ho Erbium$="Er Thuliu$="Tm Ytterb$="Yb Luteti$="Lu Hafniu$="Hf Tantal$="Ta Tungst$="W Rheniu$="Re Osmium$="Os Iridiu$="Ir Platin$="Pt Gold$="Au Mercur$="Hg Thalli$="Tl Lead$="Pb Bismut$="Bi Poloni$="Po Astati$="At Radon$="Rn Franci$="Fr Radium$="Ra Actini$="Ac Thoriu$="Th Protac$="Pa Uraniu$="U Neptun$="Np Pluton$="Pu Americ$="Am Curium$="Cm Berkel$="Bk Califo$="Cf Einste$="Es Fermiu$="Fm Mendel$="Md Nobeli$="No Lawren$="Lr Ruther$="Rf Dubniu$="Db Seabor$="Sg Bohriu$="Bh Hassiu$="Hs Meitne$="Mt Darmst$="Ds Roentg$="Rg Copern$="Cn Ununtr$="Uut Flerov$="Fl Ununpe$="Uup Liverm$="Lv Ununse$="Uus Ununoc$="Uuo ?VAR(LEFT$(E,6ドル)+"$")

The first 6 characters of each name are unique.

VAR(name) returns the variable with that name. Variable names are case insensitive.

#SmileBASIC, (削除) 1763 (削除ここまで) (削除) 1418 (削除ここまで) 1204 bytes

INPUT E$YDRO$="H
ELIU$="He
ITHI$="Li
ERYL$="Be
ORON$="B
ARBO$="C
ITRO$="N
XYGE$="O
LUOR$="F
EON$="Ne
ODIU$="Na
AGNE$="Mg
LUMI$="Al
ILIC$="Si
HOSP$="P
ULFU$="S
HLOR$="Cl
RGON$="Ar
OTAS$="K
ALCI$="Ca
CAND$="Sc
ITAN$="Ti
ANAD$="V
HROM$="Cr
ANGA$="Mn
RON$="Fe
OBAL$="Co
ICKE$="Ni
OPPE$="Cu
INC$="Zn
ALLI$="Ga
ERMA$="Ge
RSEN$="As
ELEN$="Se
ROMI$="Br
RYPT$="Kr
UBID$="Rb
TRON$="Sr
TTRI$="Y
IRCO$="Zr
IOBI$="Nb
OLYB$="Mo
ECHN$="Tc
UTHE$="Ru
HODI$="Rh
ALLA$="Pd
ILVE$="Ag
ADMI$="Cd
NDIU$="In
IN$="Sn
NTIM$="Sb
ELLU$="Te
ODIN$="I
ENON$="Xe
AESI$="Cs
ARIU$="Ba
ANTH$="La
ERIU$="Ce
RASE$="Pr
EODY$="Nd
ROME$="Pm
AMAR$="Sm
UROP$="Eu
ADOL$="Gd
ERBI$="Tb
YSPR$="Dy
OLMI$="Ho
RBIU$="Er
HULI$="Tm
TTER$="Yb
UTET$="Lu
AFNI$="Hf
ANTA$="Ta
UNGS$="W
HENI$="Re
SMIU$="Os
RIDI$="Ir
LATI$="Pt
OLD$="Au
ERCU$="Hg
HALL$="Tl
EAD$="Pb
ISMU$="Bi
OLON$="Po
STAT$="At
ADON$="Rn
RANC$="Fr
ADIU$="Ra
CTIN$="Ac
HORI$="Th
ROTA$="Pa
RANI$="U
EPTU$="Np
LUTO$="Pu
MERI$="Am
URIU$="Cm
ERKE$="Bk
ALIF$="Cf
INST$="Es
ERMI$="Fm
ENDE$="Md
OBEL$="No
AWRE$="Lr
RUTH$="Rf
UBNI$="Db
EABO$="Sg
OHRI$="Bh
ASSI$="Hs
EITN$="Mt
ARMS$="Ds
OENT$="Rg
OPER$="Cn
NUNT$="Uut
LERO$="Fl
NUNP$="Uup
IVER$="Lv
NUNS$="Uus
NUNO$="Uuo
E$=VAR(MID$(E,ドルLEN(E$)<13,4)+"$")

The substring of length 4, starting at index 1, is unique for all element names, except Rutherfordium and Ruthenium. Rutherfordium is handled as a special case, by checking if the name is 13 characters or longer.

VAR(name) returns the variable with that name. Variable names are case insensitive.

deleted 122 characters in body
Source Link
12Me21
  • 6.8k
  • 1
  • 23
  • 40
Loading
Source Link
12Me21
  • 6.8k
  • 1
  • 23
  • 40
Loading

AltStyle によって変換されたページ (->オリジナル) /