Compare commits

..

3 Commits

Author SHA1 Message Date
fc073de1de
fix json types 2024-11-02 14:48:27 +01:00
1d945977dc
add git repo 2024-11-02 14:48:05 +01:00
1fda84bdef
relative score is fairer to players with fewer prefs 2024-11-02 14:47:27 +01:00
3 changed files with 14 additions and 5 deletions

View File

@ -89,7 +89,7 @@ def apply_brute_force(players, preferences):
print(result[2]) print(result[2])
# team_table(score, team0, team1) # team_table(score, team0, team1)
return best_score[0] return best_percentage[0]
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -200,9 +200,17 @@ function App() {
{SubmitButton({ person, players })} {SubmitButton({ person, players })}
<p>now: click submit.</p> <p>now: click submit.</p>
</div> </div>
<p className="read-the-docs">
suggested teams are not updated right away. don't try to hack the
algorithm ;D
</p>
{TeamTables()} {TeamTables()}
<p className="read-the-docs"> <p className="read-the-docs">
something not working? message <a href="https://t.me/x0124816">me</a>. something not working? message <a href="https://t.me/x0124816">me</a>.
sources:{" "}
<a href="https://git.0124816.xyz/julius/teambuilding" key="gitea">
<img src="gitea.svg" alt="gitea" height="20" />
</a>
</p> </p>
</> </>
); );

View File

@ -1,4 +1,3 @@
import * as React from "react";
import Table from "@mui/material/Table"; import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody"; import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell"; import TableCell from "@mui/material/TableCell";
@ -8,12 +7,14 @@ import TableRow from "@mui/material/TableRow";
import Paper from "@mui/material/Paper"; import Paper from "@mui/material/Paper";
import data from "./table.json"; import data from "./table.json";
type Row = [player: string, fulfilled: number, total: number];
export default function TeamTables() { export default function TeamTables() {
return ( return (
<> <>
{Object.keys(data).map((teamname) => ( {Object.entries(data).map(([teamname, rows]) => (
<> <>
<h1>{teamname as String}</h1> <h1>{teamname}</h1>
<TableContainer component={Paper}> <TableContainer component={Paper}>
<Table <Table
sx={{ m: "8px auto" }} sx={{ m: "8px auto" }}
@ -27,7 +28,7 @@ export default function TeamTables() {
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
{data[teamname].map((row) => ( {(rows as Row[]).map((row: Row) => (
<TableRow <TableRow
key={row[0]} key={row[0]}
sx={{ "&:last-child td, &:last-child th": { border: 0 } }} sx={{ "&:last-child td, &:last-child th": { border: 0 } }}