Package: code-faster
Code FasterCross-platform command line utility for bootstrapping online codes (especially codeforces) and running with automatic testing.IndexUsesExampleInstallingSetting up with VSCodeUsesThis package installs two commands:cfetchThis will fetches the code from given url.usage:cfetch[-h][-l{cpp,java,py}][-dDIR]url
positionalarguments:
urlurlofthecode

optionalarguments:
-h,--helpshowthishelpmessageandexit-l,--language{cpp,java,py}defaultiscpp
-d,--dirDIRifgiventhenusesthisdirandlanguageflagwillbeignored.If dir is provided (language flag will be ignored) then it'll copy the contents of your sample dir into the created one. Using this you can use your own template for any language whatsoever. However, runner will still work only on supported languages.example:cfetchhttp://codeforces.com/problemset/problem/1/AThis will create a folder named CF1-A in the current directory with sample test cases and main.cpp file.crunThis will run the file and if there are test cases present in the file's directory it will run them too.crun<file-path>[args]Where args are compiler args for compiled languages like c++ and java.example:crunCF1-A\main.cppThis will create a folder for binaries in the file's directory with the output of sample tests. It will also generates the test report.You can manually create more test files.
Supported formats are:InputOutput.i.txt.o.txt.i.o.input.outputExampleFirst we will fetch a problem fromcodeforces.com>cfetchhttp://codeforces.com/problemset/problem/1/A
CF1-Acreated
test_1created
main.cppcreatedNow we will try to run it with our sample generated code.>crunCF1-A\main.cpp
g++-oCF1-A\bin\main.exeCF1-A\main.cpp========================================test_1FAILED
----------------------------------------[output]6----------------------------------------[answer]4========================================:(0/1passed.Now fix the main.cpp file to solve the problem.intmain(){usingnamespacestd;ios_base::sync_with_stdio(false);cin.tie(0);intn,m,a;cin>>n>>m>>a;intr=((n+a-1)/a)*((m+a-1)/a);cout<<r<<'\n';}>crunCF1-A\main.cpp
g++-oCF1-A\bin\main.exeCF1-A\main.cpp========================================test_1PASSED========================================:)1/1passed.InstallingYou can install frompypi.pipinstallcode-faster-UOr, you can install directly from the repository using pip.pipinstallgit+https://github.com/rahulsrma26/code_fasterSetting up with VSCodeYou can set keyboard shortcuts to any editor basically. There are plenty of extensions in VSCode that can do that but for demonstration we will be usingCode RunnerFor code-runner, editsettings.jsonfile in.vscodefolder.{"code-runner.fileDirectoryAsCwd":true,"code-runner.runInTerminal":true,"code-runner.saveFileBeforeRun":true,"code-runner.executorMap":{"cpp":"crun $fileName","java":"crun $fileName","python":"crun $fileName"}}Now to run a file just open it and presscontrol+option+n(on mac)
orcontrol+alt+n(on pc).Note: If you are usingcondaenvironments and if it's not added to the path environments (or bash). Thencrunmay be unaccessible in the terminal by default. So, you either need to activate it in the terminal, or you need to update the shell args."terminal.integrated.shellArgs.windows":["/K","<conda-install-path>/Scripts/activate && conda activate <your-env>"]For linux you can changeterminal.integrated.shellArgs.linuxand for mac changeterminal.integrated.shellArgs.osx