Skip to content

Facemash App built with PHP Laravel Framework. As featured in the movie "The Social Network".

License

Notifications You must be signed in to change notification settings

Jyotsna-Singh/Facemash-Laravel

Repository files navigation

Facemash App - As featured in the movie "The Social Network".



This project is a clone of the FaceMash App as shown in the movie "The Social Network". It allows the players to rate two photos competitively. It uses the Elo Algorithm to calculate the rankings, expected probability of winning and losing. This app has been built with the PHP Laravel 5 Framework and uses Bootstrap for the Front-end.

  • Features/Technologies:
    • Laravel 5 Framework
    • Elo Algorithm
    • Bootstrap Framework

Version

1.0.0 License

Live Demo - FaceMash

alt tag

Snapshots

Game
alt text
Bio
alt text
Statistics
alt text
Ranks
alt text

Elo Algorithm

Performance isn't measured absolutely; it is inferred from wins, losses, and draws against other players. Players' ratings depend on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them. Both the average and the spread of ratings can be arbitrarily chosen. Elo suggested scaling ratings so that a difference of 200 rating points in chess would mean that the stronger player has an expected score (which basically is an expected average score) of approximately 0.75, and the USCF initially aimed for an average club player to have a rating of 1500.

A player's expected score is his probability of winning plus half his probability of drawing. Thus an expected score of 0.75 could represent a 75% chance of winning, 25% chance of losing, and 0% chance of drawing. On the other extreme it could represent a 50% chance of winning, 0% chance of losing, and 50% chance of drawing. The probability of drawing, as opposed to having a decisive result, is not specified in the Elo system. Instead a draw is considered half a win and half a loss.

If Player A has a rating of R_{A} and Player B a rating of R_{B}, the exact formula  for the expected score of Player A is

E_{A}={\frac {1}{1+10^{(R_{B}-R_{A})/400}}}.

Similarly the expected score for Player B is

E_{B}={\frac {1}{1+10^{(R_{A}-R_{B})/400}}}.

When a player's actual tournament scores exceed his expected scores, the Elo system takes this as evidence that player's rating is too low, and needs to be adjusted upward. Similarly when a player's actual tournament scores fall short of his expected scores, that player's rating is adjusted downward. Elo's original suggestion, which is still widely used, was a simple linear adjustment proportional to the amount by which a player overperformed or underperformed his expected score. The maximum possible adjustment per game, called the K-factor, was set at K = 16 for masters and K = 32 for weaker players.

Supposing Player A was expected to score E_{A} points but actually scored S_{A} points. The formula for updating his rating is

R_{A}^{\prime }=R_{A}+K(S_{A}-E_{A}).

This update can be performed after each game or each tournament, or after any suitable rating period. An example may help clarify. Suppose Player A has a rating of 1613, and plays in a five-round tournament. He or she loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score, calculated according to the formula above, was (0.51 + 0.76 + 0.88 + 0.56 + 0.28) = 2.99. Therefore, the player's new rating is (1613 + 32×(2.5 − 2.99)) = 1597, assuming that a K-factor of 32 is used.

Note that while two wins, two losses, and one draw may seem like a par score, it is worse than expected for Player A because his or her opponents were lower rated on average. Therefore, Player A is slightly penalized. If Player A had scored two wins, one loss, and two draws, for a total score of three points, that would have been slightly better than expected, and the player's new rating would have been (1613 + 32×(3 − 2.99)) = 1613.



Vendors

Laravel - https://laravel.com/

License

MIT License

Laravel

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:

Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation give you tools you need to build any application with which you are tasked.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The Laravel documentation is thorough, complete, and makes it a breeze to get started learning the framework.

If you're not in the mood to read, Laracasts contains over 900 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About

Facemash App built with PHP Laravel Framework. As featured in the movie "The Social Network".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages