New. Onion Domain

Facemash Clone

Rate and compare adorable animals head-to-head using the ELO rating system.

How it works

One vote at a time. Ratings shift based on who you pick.

Pick a favorite

Click the photo you find more adorable in each head-to-head matchup.

ELO ratings

Ratings update with the ELO algorithm. Winners gain points, losers lose them, scaled by the rating gap.

Watch the leaderboard

Rankings update in real-time as animals battle for the top spot.

About this project

Remember Facemash from The Social Network? Facemash Clone is a wholesome recreation. The 2010 film's opening scene shows the original Facemash being built in a Harvard dorm room. It later became the predecessor to Facebook.

We replaced the controversial original concept with adorable animals, but kept the ELO rating system from the movie. Vote for your favorites and watch the most popular climb. All photos are sourced from Unsplash.

This project is a technical demonstration inspired by the movie. Not affiliated with Facebook, Meta, or the film.

How the math works

A technical overview of the Elo rating algorithm with examples in common languages.

The formula

Each player has a rating R. When two players face off, the system computes an expected score based on their rating gap.

E_a = 1 / (1 + 10^((R_b - R_a) / 400))

After the match, ratings update by how much the actual outcome differed from the expected one.

R_a' = R_a + K * (S_a - E_a)

S_a is the actual outcome (1 for a win, 0 for a loss, 0.5 for a draw). K caps how much ratings can shift per match. Common values: 32 for casual play, 16 to 24 for competitive.

JavaScript
function elo(rA, rB, scoreA, k = 32) {
  const eA = 1 / (1 + Math.pow(10, (rB - rA) / 400));
  return Math.round(rA + k * (scoreA - eA));
}

// A (1500) beats B (1600)
elo(1500, 1600, 1); // → 1521
elo(1600, 1500, 0); // → 1579
Go
package elo

import "math"

func Update(rA, rB, scoreA, k float64) int {
    eA := 1.0 / (1.0 + math.Pow(10, (rB-rA)/400))
    return int(math.Round(rA + k*(scoreA-eA)))
}

// A (1500) beats B (1600)
// Update(1500, 1600, 1, 32) → 1521
// Update(1600, 1500, 0, 32) → 1579
PHP
<?php
function elo(float $rA, float $rB, float $scoreA, float $k = 32): int {
    $eA = 1 / (1 + pow(10, ($rB - $rA) / 400));
    return (int) round($rA + $k * ($scoreA - $eA));
}

// A (1500) beats B (1600)
echo elo(1500, 1600, 1); // 1521
echo elo(1600, 1500, 0); // 1579
Python
def elo(r_a: float, r_b: float, score_a: float, k: float = 32) -> int:
    e_a = 1 / (1 + 10 ** ((r_b - r_a) / 400))
    return round(r_a + k * (score_a - e_a))

# A (1500) beats B (1600)
elo(1500, 1600, 1)  # → 1521
elo(1600, 1500, 0)  # → 1579