Skip to content

Quickstart

This is the fastest path from zero to a working algo program.

algo is a competitive programming language that compiles to readable C++17.

The workflow is:

  1. Write input.alg
  2. Optionally run ./algo format input.alg
  3. Run ./algo compile input.alg -o output.cpp
  4. Compile the generated C++ with g++
  5. Run or submit the result
  • A POSIX shell for the ./algo wrapper
  • JDK 17 or newer
  • g++ with C++17 support

On Ubuntu or Debian:

Terminal window
sudo apt install openjdk-17-jdk g++
Terminal window
git clone https://github.com/jiupr/algo.git
cd algo

Create aplusb.alg:

input:
a, b: int
println a + b

Compile it:

Terminal window
./algo format aplusb.alg -o aplusb.alg
./algo compile aplusb.alg -o aplusb.cpp
g++ -std=c++17 -O2 aplusb.cpp -o aplusb

Run it:

Terminal window
echo "3 4" | ./aplusb

Output:

7