A periodic table in Lua
To import everything, simply put this at the top of your Lua file:
require('periodic')
Now, the global table will be filled with the following tables for use:
periodic
,pdt
: Periodic Tablenumtosy
,nts
: Atomic number to symbol converternumtoname
,ntn
: Atomic number to name converter
The periodic table has these following fields:
mass
: Atomic massnumber
: Atomic numbername
: Name of element
To use, simply access whichever field of an element on the periodic table like so:
periodic.Hg.mass
pdt.Hg.mass
pdt.mercury.mass
periodic.mercury.mass
To convert atomic number to symbol, do this:
numtosy[15]
nts[15]
To convert atomic number to name, do this:
numtoname[15]
ntn[15]