Local vars = strlengths = string.len(vars) If we use os.time() function for perform the random operation by using the formulas like x * 202, x*1234567%y. Then it will print it on the output console. Here we used some string input types as the first variable and second variable we calculate the string lengths and randomseed() function will calculate some mathematical expressions and formulas. In second example we used additionally loop like do statement for checking the user input conditions first it will check and execute the conditions once the loop is executed if the condition is not satisfied the loop will terminate or exit it. Return math.floor((math.random(math.randomseed(os.time()+x))*202)) Io.write("Please enter your first input values :\n ", string.lower(vars), "\n") Io.write("Welcome To My Domain its a first example :\n ", string.upper(vars), "\n") Io.write("Your second string value is :\n ", string.find(vars, "lower"), "\n") Io.write("Your first string value is:\n ", string.gsub(vars, "first", "value"), "\n") Io.write("vars Length :\n ", string.len(vars), "\n") Vars = "Please enter your first string value it will, be calculates the string functions like length, gsub, lower and upper string values" When we are giving and passing the inputs to the method it will calculates and operates the mathematical functions it also supports and used the other mathematical functions like sqrt(), min(), max(), ceil(), floor() for each functions the user input values are calculated by using the mathematical formulas and expressions. In above example we used random() function of the mathematical libraries in the script. Print("Thanks for the users your first example completed successfully") Given below are the examples of Lua random: Example #1Ĭode: print("Your first example started:") The parameters are used and exactly match the local variables, functions and we used number of parameters it is different from its number of arguments and it seems to be adjusted the number of arguments and number of parameters in the multiple assignments if we use additional arguments or parameters in the method it will thrown away from the method and it gives the nil as the value when we get the extra or additional parameters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |