< Back
October 08

TPC Setup Guide

Windows

  1. Make sure you have Terminal app installed in your system. You can do so by searching for Terminal in windows start menu.

If you don’t have the Terminal app you can install it from the Microsoft Windows Store.

  1. Check if you have g++ installed by typing in g++ --version. If it returns a version you are all set and can move on to the VS Code setup.

  2. If not, no worries. Visit Scoop.sh. Copy the Given commands show right below QuickStart. Same commands are pasted below for reference.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

Copy the commands given above and paste them in your Terminal.

If you experience any errors try updating your Powershell app from the Microsoft store, Or switching to a better internet connection.

Close and reopen your Terminal.

  1. On Scoop.sh Search for Mingw. Find the one labelled as mingw in main. Futher paste the given command in your Terminal.
scoop install main/Mingw

If you get an error saying “scoop is not a valid command”. Try closing and reopening your Terminal.

  1. Close you Terminal and reopen it. Type in g++ and voila! You have the mingw compiler installed and running.

MacOS

  1. Open Terminal in MacOS. Check if you have g++ installed by typing in g++ --version. If it returns a version you are all set and can move on to the VS Code setup.

  2. If not, no worries. Check if you have brew installed by typing in brew --version. If you have brew Installed you can skip to step 6.

  3. If not, Head on to Brew.sh and copy the given command and paste it into your terminal.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Once you have brew installed, type in brew install gcc in your terminal.

  2. Once the installation is complete, type in g++ --version to check if the installation was successful. If you see a version you are all set.

VS Code

  1. Download VS Code from Code.visualstudio.com. Beware Visual Studio Code and Visual Studio are two different programs. Vs code is a code editor while the latter is a full fledged IDE.

  2. Download the Coderunner extension using the VS code extensions tab.

  3. Go to extensions > Coderuner > Coderunner Settings. Further look for Run in Terminal and tick the box. Then go ahead and also tick the box for save file before run.

  1. Once you have Coderunner downloaded let’s create a new file with Ctrl+n. Input this basic hello world program in C++.
#include <iostream>
using namespace std;

int main() {
    cout << "Hello World!";
    return 0;
}
  1. Save the file with a .cpp extension, at your desired place.

  2. Now press Ctrl+Alt+n to run the code. You should see the output in the terminal below.

  3. If you see the output you are all set!.

Competitive Programming

Now let’s setup all the convniences for Competitive Programming.

  1. Download the Competitve Programming Helper extension from the VS Code extensions tab.

  1. Go to your preferred browser, Firefox/Chrome recommended. Install the Competitive Companion extension.

Firefox link - https://addons.mozilla.org/en-US/firefox/addon/competitive-companion/

Chrome link - https://chromewebstore.google.com/detail/competitive-companion/cjnmckjndlpiamhfimnnjmnckgghkjbl

  1. For you convenience create a new folder on your system for all you competitive programming files.

  2. Now you are all set to start your competitive programming journey. Good luck!

< Back