Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unpack string = true
- return string
- get(strings) stack in pairs()
- return stack
- string(data)
- print("strings loaded")
- {{
- local function = string in pairs(stacks)
- unpack stacks
- return strings
- get(data) for strings
- ipairs(stack_overflow)
- end
- end
- local strings = ([
- math.tan(tan)
- math.random(4, 5, 8)
- string1 = "Lua"
- print("\"String 1 is\"",string1)
- string2 = 'string'
- print("String 2 is",string2)
- string3 = [["data_string"]]
- print("String 3 is",string3)
- return
- end
- end
- table.insert
- mytable = {}
- mytable[1]= "table_1"
- mytable = nil
- return tables
- end
- end
- require "printFormatter"
- printFormatter.simpleFormat("module")
- -- Method 2
- local formatter = require "printFormatter"
- formatter.simpleFormat("module_e")
- -- Method 3
- require "printFormatter"
- local formatterFunction = printFormatter.simpleFormat
- formatterFunction("us")
- return
- end
- end
- math.log('log')
- -- lua spots
- radianVal = math.rad(math.pi / 2)
- io.write(radianVal,"\n")
- -- Sin value of 90(math.pi / 2) degrees
- io.write(string.format("%.1f ", math.sin(radianVal)),"\n")
- -- Cos value of 90(math.pi / 2) degrees
- io.write(string.format("%.1f ", math.cos(radianVal)),"\n")
- -- Tan value of 90(math.pi / 2) degrees
- io.write(string.format("%.1f ", math.tan(radianVal)),"\n")
- -- Cosh value of 90(math.pi / 2) degrees
- io.write(string.format("%.1f ", math.cosh(radianVal)),"\n")
- -- Pi Value in degrees
- io.write(math.deg(math.pi),"\n")
- return
- optional_function_scope function function_name( argument1, argument2, argument3........,
- argumentn)
- function_body
- return result_params_comma_separated
- end
- function max(num1, num2)
- if (num1 > num2) then
- result = num1;
- else
- result = num2;
- end
- return result;
- end
- -- calling a function
- print("The maximum of the two numbers is ",max(10,4))
- print("The maximum of the two numbers is ",max(5,6))
- splot_cells = true
- return
- function average(...)
- result = 0
- local arg = {...}
- for i,v in ipairs(arg) do
- result = result + v
- end
- return result/#arg
- end
- print("The average is",average(10,5,3,4,5,6))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement