Giter Club home page Giter Club logo

soccer-challenge's Introduction

Soccer Challenge

A command-line application that calculates the ranking table for a soccer league.

Running Locally

First, set up a virtual environment. Assuming you have python3 installed already, just run:

python3 -m venv myenv

Next, activate the virtual environment. On Mac OS, run:

source myenv/bin/activate

Finally, use pip to install the dependencies:

pip install -r requirements.txt

You can now run the program with:

cat sample-input.txt | python3 main.py

This repository contains the needed sample-input.txt file, but you're welcome to test on another filename.

Running Tests

If you've already set up a virtual environment and installed dependencies as described in the "Running Locally" section, then you can run the entire test suite with:

pytest

You can run an individual test file by providing the relative path:

pytest tests/test_league.py

List of Improvements

I spent around 3 hours on this, +/- 15 minutes.

Ruby is my main language, and I have some familiarity with python but I'm sure there are some python conventions I might not be quite be adhering to in this project. The biggest thing that some extra time could provide is for me to learn some of those conventions and make sure I'm not doing anything too weird.

Beyond that, here's a few things I would definitely do with more time:

  • Add a code linter for style checking (I'm sure this would help me with conventions)
  • Figure out how to get my tests to do relative imports of the class under test without needing the sys.path.append append trick I found on Google
  • Write some tests for main.py. Testing while using stdin and stdout seems tricky, but a refactor would probably help with this
  • Add malformed input handling. The project prompt said not to worry about this, so I didn't
  • Make it easier to run without piping input

soccer-challenge's People

Contributors

jeffmorhous avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.