'F' → Fullscreen
If the workspace is not open yet, follow Setting Up Your Workspace first — it takes about five minutes and everything below assumes it is done.
In VS Code, right-click the template-console folder, choose Copy, then Paste. Rename the copy to 1-01-hello.
Open main.lua inside it. This is already there:
io.write("What is your name? ")local name = io.read()print("Nice to meet you " .. name)Press Run. The terminal panel asks for your name and waits. Type it and press Enter:
What is your name? Sam [Enter]Nice to meet you SamDo not edit conf.lua — the other file in the folder. It is what makes the Run button work. Everything you write goes in main.lua.
Add one line at the bottom and run it again:
io.write("What is your name? ")local name = io.read()print("Nice to meet you " .. name)print("Welcome to AP Computer Science Principles.")What is your name? Sam [Enter]Nice to meet you SamWelcome to AP Computer Science Principles.Now change the wording of both messages to something of your own. Run it after every change — that habit is worth more than anything else you learn today.
Make another copy of template-console, rename it 1-01-about-me, and delete everything in its main.lua.
Write three print lines that say three true things about you. Keep them appropriate for class:
print("I am in tenth grade.")print("I have never written a program before.")print("I would rather build a game than a website.")I am in tenth grade.I have never written a program before.I would rather build a game than a website.Delete one quotation mark and run it:
print("I am in tenth grade.)Error: Syntax error: main.lua:1: unfinished string near '"I am in tenth grade.)'Nothing printed at all. The program never started, because it was not valid Lua. Copy the message onto your sheet, then put the quote back.
You will see a lot of these. An error message that names a line number is doing you a favor.
1-01-hello runs, asks your name, and greets you1-01-about-me prints three true thingsAnswer the following questions before submitting your work.
Submit the required files to the appropriate dropbox.