#terminal-game #quiz #game #cli #terminal

app poengsum

CLI-application for generating quiz leaderboards in the terminal

7 releases

Uses new Rust 2024

new 0.2.2 Apr 29, 2025
0.2.1 Apr 29, 2025
0.1.3 Apr 26, 2025

#561 in Command line utilities

Download history 407/week @ 2025-04-22

407 downloads per month

MIT license

74KB
2.5K SLoC

Build Status (nightly) Build Status (stable)

Test Status Lint Status

Latest Version AUR Version

License:MIT Coverage Status

poengsum

Quickly generate a leaderboard for a quiz from your terminal.

Input

You write the score of each team in a file called poengsum.txt, like in this example:

Nester Grønn: 13 20
Det klør på quizzen: 6 12
Brew wars: Return of the Heimert: 6 29 9
2. Etg.: 12 10
Camp Royal: 32 20 25
The Boratas: 22 20
De Tilfeldige: 20 14 9
Kate's Bush: 42.5 21 42.5
Blank: 21 16
Navigators (gir aldri opp): 19.5 17 9
The Good Seeds: 49 47 47
Sølvkre: 32 24 13
Dreit på draget laget: 23 21 16
Guranarane: 36.5 31 45
De anonyme: 11 13
Null peiling: 11 13

Each line contains one team, followed by a colon, and then whitespace separated point values for each round. Team names can include a colon. The points follow the last colon on each line. Teams that have not participated in all rounds will have a score of 0 in those rounds they were not participating in. It supports UTF-8.

The program will then parse this file when ran in the same directory, and gives helpful and easy-to-understand error messages if issues arise with reading or parsing it.

Output

You can then display the leaderboard for the total sum of all rounds thus far by entering poengsum in the terminal, in the same directory as poengsum.txt.

poengsum
16. Det klør på quizzen: 18
15. 2. Etg.: 22
13. De anonyme: 24
13. Null peiling: 24
12. Nester Grønn: 33
11. Blank: 373
10. The Boratas: 423
9. De Tilfeldige: 432
8. Brew wars: Return of the Heimert: 442
7. Navigators (gir aldri opp): 45.52
6. Dreit på draget laget: 60
5. Sølvkre: 691
4. Camp Royal: 771
3. Kate's Bush: 106
2. Guranarane: 112.5
1. The Good Seeds: 143

You can also see the amount of positions that each team climbed or fell since the previous round, denoted by the arrow after their score. If your terminal supports colored text, then these will also be colored red and green for a more pleasant viewing experience.

You can also specify a specific sequence of rounds as command-line arguments to the command poengsum, and it will display the score, as if these rounds were replayed in the given sequence.

For example, if i want to see how it would have played out if round 2 happened first, and then round 1 happened twice, i can do this:

poengsum 2 1 1
16. Det klør på quizzen: 24
15. 2. Etg.: 34
13. De anonyme: 35
13. Null peiling: 35
12. Brew wars: Return of the Heimert: 412
11. Nester Grønn: 461
10. De Tilfeldige: 541
9. Navigators (gir aldri opp): 56
8. Blank: 58
7. The Boratas: 64
6. Dreit på draget laget: 67
5. Camp Royal: 84
4. Sølvkre: 88
3. Guranarane: 1041
2. Kate's Bush: 1061
1. The Good Seeds: 145

How convenient!

Installation

Cargo

You can install this program from crates.io through Cargo, by running this command in your command-line:

cargo install poengsum

This will by default install the application to the directory ~/.cargo/bin/. Make sure ~/.cargo/bin/ is included in your PATH.

Arch-linux (AUR)

This program is also available on the AUR under the name poengsum. If you're running an Arch-based distro, you can get it there.

yay -S poengsum

Dependencies

~0.3–1MB
~17K SLoC