🕹️ A fair match generator for League of Leagends and Valorant that divides 10 players into two balanced teams based on their tiers and points.
- 🏅 Player Tier Input: Select each player's rank.
- ⚖️ Fair Team Generation: Automatically create two balanced teams based on player points.
- 📊 Result: Displays the generated teams and their total points in a modal.
src
├── assets
├── components
│ ├── Footer.jsx
│ ├── Header.jsx
│ ├── logo.jpg
│ ├── OnBoarding.jsx
│ ├── PlayerLol.jsx
│ ├── PlayerVlrt.jsx
│ ├── ResultModal.jsx
│ ├── Spinner.jsx
│ ├── WarningModal.jsx
├── pages
│ ├── Home.jsx
│ ├── Lol.jsx
│ ├── Vlrt.jsx
├── styles
│ ├── constants.json
│ ├── index.css
│ ├── players.scss
│ ├── reset.scss
├── util
│ ├── teamGenerator.js
│ ├── tierPoints.js
├── App.jsx
├── index.js
- The tiers are mapped to points as follows:
- Valorant
Iron: 7, Bronze: 13, Silver: 17, Gold: 25, Platinum: 29, Diamond: 37, Ascendant: 43, Immortal: 45, Radiant: 48
- League of Legends
Iron: 7, Bronze: 13, Silver: 17, Gold: 25, Platinum: 32, Emerald: 40, Diamond: 48, Master: 54, GrandMaster: 59, Challenger: 64,
- The players are sorted by points in descending order.
- Players are distributed between two teams such that the total points of both teams are as close as possible.
- Generate Combinations: Create all possible 5-player combinations for
team1
. - Calculate Differences: For each combination, calculate the point difference between
team1
andteam2
. - Find Optimal Teams: Track the combination with the smallest point difference for the most balanced teams.
- Sort Teams: Sort
team1
andteam2
by points in descending order.
- Organize by Position: Group players by their selected positions and sort by points.
- Validate Positions: Ensure each position (Top, Jungle, Mid, ADC, Support) has at least two players. If not, return an error.
- Recursive Team Assignment: Assign players to
team1
andteam2
for each position, ensuring no player is used in both teams. - Optimize Balance: Track and update the team combination with the smallest point difference.
- Sort by Position: Once optimized, sort each team by position for clarity.
-
Select Your Game Choose the game you want to create a balanced match for.
-
Enter Players' Ranks
Input the ranks of each player. Players who do not select a tier will be considered at the lowest tier for calculation purposes.
-
Generate Fair Match
Click on 'Generate Fair Match!' to see the balanced match results.
If you have any questions or suggestions, feel free to reach out:
📧 Email: [email protected]
📱 GitHub: cxaos