lab 04
This commit is contained in:
3 files changed
+95
No files matched your search
@@ -0,0 +1,8 @@
|
||||
defmodule Lab4b do
|
||||
for line <- String.split(File.read!("atomic-weights.txt"), "\n", trim: true) do
|
||||
[_number, symbol, _name, weight] = String.split(line)
|
||||
def atomic_weight(unquote(symbol)), do: unquote(String.to_float(weight))
|
||||
end
|
||||
|
||||
def atomic_weight(_symbol), do: -1
|
||||
end
|
||||
Reference in new issue
Block a user