GithubHelp home page GithubHelp logo

sample-league-system's Introduction

Sample League System

Purpose

This project started for a job application and became a challange after a while.

What it does now

Now we can start a league and build the fixture, see all matches, point table and play matches week by week or all once.

How to setup

Simple; prepare a database using sql file in the repo, change db configurations on /class/db.php and hit the index.php

So what

What about adding some features or improve especially fixture algorithm. At least you can test and add new issues. All wellcome.

sample-league-system's People

Watchers

Murat Yüksel avatar

Forkers

daltlab

sample-league-system's Issues

Fixture generating question

In league class prepareFixture() method I had to put a while loop for retrying generate all matches, adding all teams for the week and not putting same team twice in a week. If I remove while and making it with looping over $matches only in some conditions it skips some matches, don't know why.

So now algorithm goes like this:

  • truncate matches
  • prepare fixture
  • - get all match possibilities
  • - shuffle these matches
  • - for every week (team count - 1)
  • - - while not all teams used for that week
  • - - loop through matches and
  • - - if match's teams didn't used that week add that match to week and delete it from matches
  • - - in case of infinite loop cut the action in while after 50 tries and get back to first step

I didnt like it, need to be better...

Team class error

In some configurations team class team count gets an error:

PHP Parse error: syntax error, unexpected '[' in /home/muratyuk/public_html/proj/champions/class/team.php on line 106

We should use an array function instead using [] directly.

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.