⏰ after the Vault VS CODE PRACTICE · UNITS 1.1–1.3

⚔️ Console Quest: The VS Code Gauntlet

You escaped the Precedence Vault by predicting Java. Now you write it — for real, in VS Code, no Trinket training wheels. You'll build one program, ConsoleQuest, five levels deep: every level uses a skill from this unit, and by the end your console prints a working game screen. Future Video Game Design team: this is your first game loop's ancestor.

🛠 Setup — 3 minutes, do this exactly

1. Make a folder called JavaPractice — no spaces in the name, not inside Downloads.
2. In VS Code: File → Open Folder → pick JavaPractice. (Opening a loose file instead of a folder is the #1 cause of "Could not find or load main class.")
3. New file, saved as exactly ConsoleQuest.java — capital C, capital Q. The class name and file name must match letter for letter.
4. Type the shell below, then run it with the Run link above main (or javac ConsoleQuest.java then java ConsoleQuest in the terminal). It must run clean BEFORE you start Level 1.
public class ConsoleQuest
{
    public static void main(String[] args)
    {

    }
}

Red squiggles about "Unresolved compilation problem"? Check: file name matches class name exactly · no .java inside the class name · quotes are straight " not curly — retype them if you pasted.

🏆 The five levels — build them IN ORDER, run after every level

LVL 1
Title screen. A multiline comment header /* */ with the game name and your name, then print a bordered title screen (at least 4 println lines). Add a // comment labeling the section. Skills: comments, println.
LVL 2
Player stats. Declare your hero: 2+ String variables (first and last name), 2+ ints (level, gold...), and 1 double (crit chance...). Print a stats block using concatenation. Skills: types, variables, concatenation.
LVL 3
Gamertag. Forge your hero's tag from your name: .substring() on BOTH names plus something computed from .length(), built into one String variable. Skills: String methods.
LVL 4
Battle math. Three computed lines: damage using parentheses that beat precedence like (strength + weaponPower) * level · turns-until-crit using % · potions you can afford using int division (gold / potionCost — the change is dropped, and that's correct). Skills: operators, precedence, modulo, int division.
LVL 5
Loot roll. End every run with a d20: int lootRoll = (int)(Math.random() * 20) + 1; printed on the screen. Run the program three times — the roll must change. Skills: Math.random, casting.
⚡ BOSS
Finished early? Add a rival hero and compute both damages · make the average damage EXACT with a double cast: (double)(damage1 + damage2) / 2 · or roll damage itself: (int)(Math.random() * damage) + 1. Video Game Design team: this stats-then-compute-then-roll pattern is the skeleton of every battle system you'll ever build.

🎯 What a finished run looks like

Yours will have your hero and numbers — but the shape should match:

=============================
       CONSOLE  QUEST
   a game by Jordan Mitchell
=============================
Hero: Jordan Mitchell
Level: 3   Gold: 247
Crit chance: 12.5%
Tag: JorMi14
Damage this hit: 69
Turns until crit: 0
Potions you can afford: 7
Loot roll (d20): 19
=============================

🚀 Pre-Flight Check

Before you screenshot: paste your whole program and hit the button. Results are grouped by level so you know exactly which one needs work.

🏆 GAUNTLET CLEARED — all five levels detected.
Run it once more, screenshot the code AND the output, and submit both.
Then take on the BOSS level — that one's for the leaderboard.
Mr. Babb · AP Computer Science A · Paul Public Charter School