A friend of mine dabbles in lua, and he recently sent me a code which applies an equation we were discussing. I personally am very mediocre with lua, but my Python senses are tingling - I feel as though this code could almost certainly be shortened. Any thoughts?
print("Choose what you want to find:")
print("Health")
print("Size")
print("Speed")
print("Average Damage")
print("")
chosen = io.read()
if chosen == 'Health' then
print("Input The Damage")
Da = io.read()
print("Input The Size")
Sz = io.read()
print("Input The Speed")
Sp = io.read()
local m = 70 * ((Da * Sz) / Sp)
print(m)
elseif chosen == 'Size' then
print("Input the Health")
h = io.read()
print("Input the Damage")
Da = io.read()
print("Input the Speed")
Sp = io.read()
local n = (h*Sp) / (70*Da)
print(n)
elseif chosen == 'Speed' then
print("Input the Health")
h = io.read()
print("Input the Damage")
Da = io.read()
print("Input The Size")
Sz = io.read()
local o = (70*Da*Sz) / h
print(o)
elseif chosen == 'Average Damage' then
print("Input the Health")
h = io.read()
print("Input The Size")
Sz = io.read()
print("Input The Speed")
Sp = io.read()
local p = (h * Sp) / (70 * Sz)
print(p)
end