Skip to content

cleytonVale/playground

 
 

Repository files navigation

Playground - A place to play programming.


In this repository I'll save all my solutions for site as Project Euler, URI,
SPOJ and etc. Most of those sites have problem that follows the structure of
the programming contest runned by ACM for students around the world. I used to
attend those competitions at my student age, but I still playing and having
some fun.

Most of the problem folow the sdtin/stdout programming contest standard. So you
can run it manually by running something like these commands:

    $ g++ 1003.cpp
    $ a.out < int.txt > out.txt

There is a virtual machine ready to run those problems. To lauch it run:

    $ vagrant up # to lauch the machine
    $ vagrant ssh # to ssh to the machine

There is a boilerplate command to create the folder structure that this project
folows. Its syntax is:

    $ new-problem problem-code [language-extension]

The structure of the problems is:

    └─┬ PROGRAMMING CONTEST SITE
      └─┬ COMPETITION NAME (if there is the concept of competition)
        └─┬ COMPETITION ROUND (if there is the concept of competition round)
          └─┬ PROBLEM-CODE
            └── PROBLEM-CODE.{c,cpp,go,js,py}
            └── in.txt
            └── out.txt
            └── problem.txt
            └── WRONG

- PROBLEM-CODE.{c,cpp,go,js,py} - Of course, contains the source code to solve
the problem.

- problem.txt - Holds the URL to the problem and the problem text. Saving it
like this, I will be able to read the problem description offline.

- in.txt - Contains the input problem. Some problem folders don't have it
because some sites don't need input files, for example projecteuler.net.

- out.txt - Contains the output of the problem. For projecteuler problems, that
you don't submit the code, just the answer, it contains the answer.

- WRONG - It is a flag file that says the answer isn't correct yet.

Following this structure, you will be able to run your code, in all supported
languages with just one command:

    $ marathon

This command already tests Go, Python, C, C++ and NodeJS code. It also checks
lint (and fix it for Go) for all those languages.

About

A place to play

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 80.9%
  • Python 8.2%
  • Shell 6.9%
  • C 3.7%
  • Other 0.3%