GithubHelp home page GithubHelp logo

cankatabaci / fixture-creator Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 99 KB

fixture-creator is a Round-robin tournament based sports fixture creator

Home Page: https://www.npmjs.com/package/fixture-creator

TypeScript 96.22% JavaScript 3.78%
round-robin-tournament npm-package football-fixture sports-fixture league-fixture fixture-creator

fixture-creator's Introduction

Fixture Creator

Node.js CI Publish Package to npmjs

Round-robin tournament based sports fixture creator

Install

npm i fixture-creator

Usage

import { FixtureCreator } from "fixture-creator";

const teams:string[] = ['Barcelona', 'Bayern Munich', 'Galatasaray'];
const fixtureCreator = new FixtureCreator();

console.log(fixtureCreator.createLeagueFixture(teams));

teams should be a array of team names as a string
teams must have at least 2 team
if teams length is odd, the team that will not play that week is shown to face 'BYE-THIS-WEEK'. If you prefer dash(-) instead of this text, you have to write false after team string

console.log(fixtureCreator.createLeagueFixture(teams, false));

fixtureCreator.createLeagueFixture(teams) returns fixture object. fixture object contains game weeks array.

{
   "weeks":[
      {
         "title":"1. Match Week",
         "matches":[
            {
               "home":"Galatasaray",
               "away":"Barcelona"
            },
            {
               "home":"Bayern Munich",
               "away":"BYE-THIS-WEEK"
            }
         ]
      },
      {
         "title":"2. Match Week",
         "matches":[
            {
               "home":"Galatasaray",
               "away":"BYE-THIS-WEEK"
            },
            {
               "home":"Barcelona",
               "away":"Bayern Munich"
            }
         ]
      },
      {
          ...
          ...
      }
   ]
}

Notes

I developed this package to use in
FIFA tournaments that we play with our friends.
We play our FIFA tournament like a classic league
so it creates(by default) a fixture that includes the return matches.

fixture-creator's People

Contributors

cankatabaci avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fixture-creator's Issues

Add package.json

Modify package.json:

  • description
  • keywords
  • name
  • homepage
  • author
  • license

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.