Q:

How to print the result of calculation lua

Local cl = rendom - or + 
Local a  = rendom number
Local x  = rendom number
Locol re = a..cl..x
Print (re) --output 5+8

I need to get the result 13
How to do that?

A:

If you want the number 13 you can try:
Local cl = rendom "m" or "p" -- m for -, p for +
Local a  = rendom number
Local x  = rendom number
Local re = 0
if cl == "m" then re = a-x end
if cl == "p" then re = a+x end
Print (re) --output 13

or
Local cl = rendom "m" or "p" -- m for -, p for +
Local a  = rendom number
Local x  = rendom number
Local re = 0
if cl == "m" then re = a-x Print(a.."-"..x, re) end
if cl == "p" then re = a+x Print(a.."+"..x, re) end

Hope this helps!

