This project allows you to test your Javascript code before submitting your answer on codeforces.com
- Clone the project
- (For windows users:) Make
cmd.exeas your default shell, you can do that by editing this parameter on your VScode settings:
"terminal.integrated.automationProfile.windows": {
"path": "cmd.exe"
}- Change the layout of your VSCODE to look like that, (just drag and drop the panels):
- Type your code inside the
mainfunction on thescript.jsfile (don't edit the upper part of the file) - Add the data test on the
input.txtfile - Run the Task by clicking on
Terminal > Run Build Task...on your VsCode menu, or use the shortcutCtr + Alt + B- Make sure that you are on the
script.jsfile before running the task
- Make sure that you are on the
- The result will be written in the
output.txtfile
- Copy the entire code from
script.jsand paste it on the submission form - Choose
Nodeas language (do not pick JavaScript)
The tasks.json file runs the following command in cmd.exe on windows, without showing you the terminal :
node script.js < ./input.txt > ./output.txt With Powershell, for example, it returns an error
It doesn't process correctly the <
- Edit the
./.vscode/tasks.jsonfile - Replace "never" by "always"
"presentation": {
"reveal": "always"
}
