Electricblaze's Lua Class Pre-lesson Quiz

10 Questions | Total Attempts: 360

SettingsSettingsSettings
Class Quizzes & Trivia

This quiz will give me a sense of my students' Lua abilities before I have begun teaching them.


Questions and Answers
  • 1. 
    What is a scope?
    • A. 

      A block of code.

    • B. 

      A donught.

    • C. 

      A type of function.

    • D. 

      A type of variable.

  • 2. 
    What is the difference between a Local Variable and a Global Variable?
    • A. 

      Local Variables can only be accessed in the scope they were created in.

    • B. 

      Local Variables can contain larger values.

    • C. 

      Local Variables are closer to home while Global Variables are around the world.

    • D. 

      Local Variables are more sensitive.

  • 3. 
    What is a while loop?
    • A. 

      A loop that takes a while to run.

    • B. 

      A loop that can contain a Local Variable.

    • C. 

      A loop that runs only while a specified condition is true.

    • D. 

      A really cool loop.

  • 4. 
    Every scope except those created by repeat loops require an 'end' statement.
    • A. 

      True

    • B. 

      False

  • 5. 
    What is an argument?
    • A. 

      A variable that is defined in a function and can only be used for it.

    • B. 

      It's what happens when two people disagree.

    • C. 

      It's what happens when two function disagrees.

    • D. 

      A type of function.

  • 6. 
    What symbol are values in a table placed in?
    • A. 

      '' - single quotes

    • B. 

      [] - brackets

    • C. 

      () - parenthesis

    • D. 

      {} - braces

  • 7. 
    How do I iterate (loop through) each key and value in a table?
    • A. 

      Use a numerical for loop.

    • B. 

      Use a generic for loop.

    • C. 

      Use a repeat loop.

    • D. 

      Use a while loop.

  • 8. 
    Which one successfully iterates through a table?
    • A. 

      For k,v in table do print(k,v) end

    • B. 

      For i = pairs(table) do print(i)

    • C. 

      For k,v in pairs(table) do print(k,v) end

    • D. 

      For i in pairs(table) do print(i) end

  • 9. 
    How you share values through all scripts in the game?
    • A. 

      Just make them global variables.

    • B. 

      Use the global table (_G). Put variables inside of _G and access them from any script.

    • C. 

      They're automatically shared.

    • D. 

      Don't.

Related Topics
Back to Top Back to top