Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --CHEESE()
- --Certified Weeb#6917 (Discord)
- --Share your results! OwO
- print("Welcome to the LUA test! There are 10 questions you'll need to answer!")
- print("Rules:")
- print("1. No looking up answers")
- print("2. No re-taking the test.")
- print("3. No asking other people for help")
- print("Allowed:")
- print("1. Studying before the test")
- print("Do you understand?")
- print("If yes then type: '1' or if no then type: '2'")
- understand = io.read()
- understood = nil
- correct = 0
- score = 0
- bonus = nil
- attempted = nil
- rating = nil
- ctt = nil
- if understand == "1" then
- understood = true
- elseif understand == "2" then
- understood = false
- end
- if understood then
- print("Great, Let's begin the test")
- ctt = true
- elseif not understood then
- print("Looks like you didn't understand, You may not start the test until you do.")
- ctt = false
- end
- if ctt then
- print("Enter your username...")
- un = io.read()
- print("Welcome, "..un)
- unr = math.random(1,1000)
- print("Your user number is : "..unr)
- print(""..un..", Are you ready?")
- io.read()
- print("Ready or not, Question 1:")
- print("What is wrong with this script?")
- print("print('This is a test)")
- print("1. There is nothing wrong.")
- print("2. There is an unfinished string")
- print("3. There is no period.")
- q1 = io.read()
- if q1 == "2" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q1 ~= "2" then
- print("Incorrect!")
- end
- print("Question 2:")
- print("What is wrong with this script?")
- print("if variable == true then dosomething() end")
- print("1. You don't need an 'end' for if statements.")
- print("2. There is nothing wrong")
- print("3. You don't need '== true'")
- q2 = io.read()
- if q2 == "3" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q2 ~= "3" then
- print("Incorrect!")
- end
- print("Question 3:")
- print("What symbol do you use to multiply values in lua?")
- print("1. '*'")
- print("2. 'x'")
- print("3. You can't multiply values in lua.")
- q3 = io.read()
- if q3 == "1" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q3 ~= "1" then
- print("Incorrect!")
- end
- print("Question 4:")
- print("What symbol do you use to divide values in lua?")
- print("1. '/'")
- print("2. The division symbol")
- print("3. You can't divide values in lua.")
- q4 = io.read()
- if q4 == "1" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q4 ~= "1" then
- print("Incorrect!")
- end
- print("Question 5:")
- print("What will this output?")
- print("local lua = {} for i=1,100 do table.insert(lua,math.random(1,100)) end print(table.concat(lua),'')")
- print("1. It will print noting.")
- print("2. A random string of numbers")
- print("3. It will error.")
- q5 = io.read()
- if q5 == "2" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q5 ~= "2" then
- print("Incorrect!")
- end
- print("Question 6:")
- print("What does print(math.random(1, 100)) do?")
- print("1. Nothing.")
- print("2. Error")
- print("3. Prints a random number between 1 and 100")
- q6 = io.read()
- if q6 == "3" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q6 ~= "3" then
- print("Incorrect")
- end
- print("Question 7:")
- print("What does this script do?")
- print("if a > b then print('test') end")
- print("1. Error.")
- print("2. Will print 'test' if a is bigger than b")
- print("3. Print's 'test'")
- q7 = io.read()
- if q7 == "2" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q7 ~= "2" then
- print("Incorrect!")
- end
- print("Question 8")
- print("How do you end a 'while true do' loop?")
- print("1. break")
- print("2. end")
- print("3. stop.")
- q8 = io.read()
- if q8 == "1" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q8 ~= "1" then
- print("Incorrect!")
- end
- print("Question 9:")
- print("What does this do?")
- print("a = true if a then print('test') end")
- print("1. Do nothing.")
- print("2. prints 'test'")
- print("3. Will print 'test' if a is true")
- q9 = io.read()
- if q9 == "3" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q9 ~= "3" then
- print("Incorrect!")
- end
- print("Question 10 (EASY!)")
- print("What language is this script coded in?")
- print("1. Lua")
- print("2. Java")
- print("3. Python")
- q10 = io.read()
- if q10 == "1" then
- print("Correct!")
- correct = correct + 1
- score = score + 10
- elseif q10 ~= "1" then
- print("Incorrect!")
- end
- print("End of the test!")
- if score == 0 then
- rating = "Did you even try?"
- elseif score == 10 then
- rating = "Rank : -F"
- elseif score == 20 then
- rating = "Rank : F"
- elseif score == 30 then
- rating = "Rank : F+"
- elseif score == 40 then
- rating = "Rank : F++"
- elseif score == 50 then
- rating = "Rank : -D"
- elseif score == 60 then
- rating = "Rank : D"
- elseif score == 70 then
- rating = "Rank : C"
- elseif score == 80 then
- rating = "Rank : B"
- elseif score == 90 then
- rating = "Rank : A"
- elseif score == 100 then
- rating = "Rank : P+"
- end
- print("Would you like to attempt the bonus question?")
- print("1 for yes and 2 for no.")
- bq = io.read()
- if bq == "1" then
- attempted = "Yes"
- print("What is a table in lua?")
- print("1. An information holder.")
- print("2. A associative array to hold numbers and strings with no limit")
- print("3. A table with four legs.")
- q11 = io.read()
- if q11 == "2" then
- print("Correct!")
- bonus = "Yes"
- elseif q11 ~= "2" then
- print("Incorrect")
- bonus = "No"
- end
- elseif bq == "2" then
- attempted = "No"
- print("Understandable")
- end
- print("Here is your profile to keep and/or share!!")
- print("-----[GENERATED PROFILE]-----")
- print("Certified Weeb's lua test!")
- print("Username : "..un)
- print("User # : "..unr)
- print("Test score : "..score.."%")
- print("Answers : "..correct.." out of 10")
- print("Rating : "..rating)
- print("Attempted Bonus? : "..attempted)
- print("Got bonus? : "..bonus)
- print("-----[GENERATED PROFILE]-----")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement