This is a command-line application written in C# that calculates the ranking table for a league based on the results of games.
To run this application, you'll need to install the .NET framework. You can install it using the dotnet-install.sh
script provided by Microsoft.
- Download the script from here.
- Open a terminal and navigate to the directory where you downloaded
dotnet-install.sh
. - Run the following command to make the script executable:
chmod +x dotnet-install.sh
- Run the script to install the .NET framework:
./dotnet-install.sh
Follow the on-screen instructions to complete the installation.
To compile the program, follow these steps:
- Clone this repository to your local machine or download the source code.
- Open a terminal and navigate to the root directory of the project.
- Run the following command to compile the program:
dotnet build
Once the program is compiled, you can run it with the following steps:
- Navigate to the directory containing the compiled executable or the project root directory.
- Run the following command to execute the program, replacing
<input_file_path>
with the path to your input file:dotnet run --project LeagueCalc <input_file_path>
For example:
dotnet run --project LeagueCalc ./input/input.txt
You can also run the program without the input file argument. In this case, the program will ask for the input data in the terminal, you can paste or write each line manually; make sure to leave an empty line and the end and press ENTER
to process the data. To do so, run the following command:
dotnet run --project LeagueCalc
You can also run the application inside a Docker container. To do so, follow these steps:
- Make sure you have Docker installed on your system.
- Open a terminal and navigate to the root directory of the project.
- Run the following command to build the Docker image:
docker build -t dotnet-test . && docker run -d --name dotnet-test dotnet-test:latest
Run your tests with the following command:
dotnet test