The default build task runs .vscode/run-active-problem.sh.
Open a .cpp or .js file.
Supported files:
*.cpp
*.js
Put sample input in:
workspace/input.txt
Use one shortcut:
| Environment | Shortcut |
|---|---|
| macOS custom local shortcut | Cmd + R |
| macOS default task | Cmd + Shift + B |
| Windows/Linux default task with Bash | Ctrl + Shift + B |
Program output is written to:
workspace/output.txt
The terminal also prints the file, language, runtime, and failures.
- Active
.cppfiles compile withg++. - Active
.jsfiles run with Node.js. - If
workspace/input.txtorworkspace/output.txtis active, the runner reuses the current problem file. - If there is no current problem file, the runner uses the most recently modified non-empty
.cppor.jsfile. - Editing and saving a non-empty problem file makes it the current runner target.
- If the active problem file is empty, the runner clears
workspace/input.txtandworkspace/output.txt.
Before running a task, VS Code saves dirty files first. This keeps Cmd + R accurate even when workspace/input.txt or workspace/output.txt is active.