feat(section): hashmap + section complete w/ quiz2

This commit is contained in:
2026-08-04 20:36:07 +02:00
parent 2844976587
commit 8b15f8d511
2 changed files with 25 additions and 0 deletions
+5
View File
@@ -27,6 +27,11 @@ fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> {
let team_1_score: u8 = split_iterator.next().unwrap().parse().unwrap();
let team_2_score: u8 = split_iterator.next().unwrap().parse().unwrap();
scores.entry(team_1_name).or_default().goals_scored += team_1_score;
scores.entry(team_2_name).or_default().goals_scored += team_2_score;
scores.entry(team_1_name).or_default().goals_conceded += team_2_score;
scores.entry(team_2_name).or_default().goals_conceded += team_1_score;
// TODO: Populate the scores table with the extracted details.
// Keep in mind that goals scored by team 1 will be the number of goals
// conceded by team 2. Similarly, goals scored by team 2 will be the