freestyle overall calculator
freestyle overall calculator
I've written freestyle overall calculator to help with calculating scores for overall for tournaments. It's written in bash, as I know bash and bash is portable (can be run inside WSL, on Android using Termux app, probably also on MacOS, but I don't have a Mac to test it). Could be also written in python, but I don't know python much. It has 2 branches currently - "main" uses the same weights for all events, "weighted" cares for different weights. It can be found on my github:
https://github.com/lavix5/footbag_overa ... /tree/main
There are README.md files, but if you have any question, ask in this thread.
https://github.com/lavix5/footbag_overa ... /tree/main
There are README.md files, but if you have any question, ask in this thread.
Jakub Mościszewski
-
- Post Master General
- Posts: 3149
- Joined: 19 Sep 2007 23:42
- Location: Canberra, Australia
- Contact:
Re: freestyle overall calculator
Sounds like a great idea. I don't know much about the programming side - how could a tournament host access and use this simply?
Re: freestyle overall calculator
All can be done locally on host computer or even Android smartphone (don't know if bash can be run inside iOS).
The simplest way is to download 2 files from my github: overall_calculator.sh and results_sort.sh from the "main" branch if every event has the same weight or from "weighted" branch if events have different weights. It can be done simply in web browser. Next part depends on the system used.
Windows:
You need to install WSL (Windows Subsystem Linux). Open PowerShell and type
Installation is only required once. Then every other time follow only steps below.
After installation is complete run WSL (just type wsl in powershell iirc, or search start menu for WSL or Ubuntu). Then change directory to where you've downloaded those 2 files, for example for download folder:
Allow both files to be executed (need to do it just once):
If you've chosen weighted calculator, create file "weights" with weights for events, for example using nano:
Then use ctrl+o to save file and ctrl+x to exit nano.
Now invoke overall_calculator.sh script with player name and classification for every player, for example:
After doing so for every player, sort results by invoking results_sort.sh script:
Now sorted results are in "results.txt". You can print its content to screen with cat, open open it with less:
In less press q to exit less.
Linux:
You can also use Linux booted liveUSB.
Change directory to where you've downloaded those 2 files, for example for download folder:
Allow both files to be executed (need to do it just once):
If you've chosen weighted calculator, create file "weights" with weights for events, for example using nano:
Then use ctrl+o to save file and ctrl+x to exit nano.
Now invoke overall_calculator.sh script with player name and classification for every player, for example:
After doing so for every player, sort results by invoking results_sort.sh script:
Now sorted results are in "results.txt". You can print its content to screen with cat, open open it with less:
In less press q to exit less.
MacOS:
MacOS ships with older bash version, so I don't know if scripts will run correctly, but steps are pretty much similar to Linux. Download folder might have different path (or not) - I don't know Mac folders' tree. I don't have Mac to test it tho.
Android:
First, install Termux app from Google Play or F-Droid Store (I recommend F-Droid, because it's privacy respecting and checks every app before allowing it on the store. Also Google Play halted updates for Termux).
https://play.google.com/store/apps/deta ... com.termux
https://f-droid.org/packages/com.termux/
Then open Termux app. Install bc if you wish to use weighted calcultor:
I recommend to create new folder:
Change directory to newly created folder:
Open nano and copy contents of both files separetely from github:
Copy content from github file, save file by ctrl+o, then exit nano by ctrl+x. Do the same for second file:
Copy content from github file, save file by ctrl+o, then exit nano by ctrl+x. Allow both files to be executed (need to do it just once):
If you've chosen weighted calculator, create file "weights" with weights for events, for example using nano:
Then use ctrl+o to save file and ctrl+x to exit nano.
Now invoke overall_calculator.sh script with player name and classification for every player, for example:
After doing so for every player, sort results by invoking results_sort.sh script:
Now sorted results are in "results.txt". You can print its content to screen with cat, open open it with less:
In less press q to exit less.
That's the simplest way I could write it. Hope it helps. I know it's not friendly for people, who don't know about programming or linux. Maybe some time in the future I'll create an app with graphical user interface, so it'll be user friendly, but time has not yet come.
The simplest way is to download 2 files from my github: overall_calculator.sh and results_sort.sh from the "main" branch if every event has the same weight or from "weighted" branch if events have different weights. It can be done simply in web browser. Next part depends on the system used.
Windows:
You need to install WSL (Windows Subsystem Linux). Open PowerShell and type
Code: Select all
wsl --install
After installation is complete run WSL (just type wsl in powershell iirc, or search start menu for WSL or Ubuntu). Then change directory to where you've downloaded those 2 files, for example for download folder:
Code: Select all
cd /mnt/c/Users/[i]user_name[/i]/Downloads/
Code: Select all
sudo chmod +x overall_calculator.sh results_sort.sh
Code: Select all
nano weights
Code: Select all
Nano editor will open, write there weights with 2 decimal points, for example:
Code: Select all
0.50 0.25 0.25
Now invoke overall_calculator.sh script with player name and classification for every player, for example:
Code: Select all
./overall_calculator.sh Jakub 1 3 3
Code: Select all
./overall_calculator.sh Daniel 2 1 2
Code: Select all
./overall_calculator.sh Matthew 3 2 1
Code: Select all
./results_sort.sh
Code: Select all
cat results.txt
Code: Select all
less results
Linux:
You can also use Linux booted liveUSB.
Change directory to where you've downloaded those 2 files, for example for download folder:
Code: Select all
cd ~/Downloads/
Code: Select all
sudo chmod +x overall_calculator.sh results_sort.sh
Code: Select all
nano weights
Code: Select all
Nano editor will open, write there weights with 2 decimal points, for example:
Code: Select all
0.50 0.25 0.25
Now invoke overall_calculator.sh script with player name and classification for every player, for example:
Code: Select all
./overall_calculator.sh Jakub 1 3 3
Code: Select all
./overall_calculator.sh Daniel 2 1 2
Code: Select all
./overall_calculator.sh Matthew 3 2 1
Code: Select all
./results_sort.sh
Code: Select all
cat results.txt
Code: Select all
less results
MacOS:
MacOS ships with older bash version, so I don't know if scripts will run correctly, but steps are pretty much similar to Linux. Download folder might have different path (or not) - I don't know Mac folders' tree. I don't have Mac to test it tho.
Android:
First, install Termux app from Google Play or F-Droid Store (I recommend F-Droid, because it's privacy respecting and checks every app before allowing it on the store. Also Google Play halted updates for Termux).
https://play.google.com/store/apps/deta ... com.termux
https://f-droid.org/packages/com.termux/
Then open Termux app. Install bc if you wish to use weighted calcultor:
Code: Select all
pkg install bc
Code: Select all
mkdir scripts
Code: Select all
cd scripts/
Code: Select all
nano overall_calculator.sh
Code: Select all
nano results_sort.sh
Code: Select all
chmod +x overall_calculator.sh results_sort.sh
Code: Select all
nano weights
Code: Select all
Nano editor will open, write there weights with 2 decimal points, for example:
Code: Select all
0.50 0.25 0.25
Now invoke overall_calculator.sh script with player name and classification for every player, for example:
Code: Select all
./overall_calculator.sh Jakub 1 3 3
Code: Select all
./overall_calculator.sh Daniel 2 1 2
Code: Select all
./overall_calculator.sh Matthew 3 2 1
Code: Select all
./results_sort.sh
Code: Select all
cat results.txt
Code: Select all
less results
That's the simplest way I could write it. Hope it helps. I know it's not friendly for people, who don't know about programming or linux. Maybe some time in the future I'll create an app with graphical user interface, so it'll be user friendly, but time has not yet come.
Jakub Mościszewski
Re: freestyle overall calculator
This seems cool, nice work. When I have some time I will check it out.
Speaking of the graphical side, maybe we could integrate as part of the footbag dictionary app I developed? I have plans to add more to the app so it is not just a dictionary but a journal/goal tracking app. Additionally, I have a bunch of notes on etymology of different tricks/concepts I will add, and this calculator would also fit nicely in it...but I suppose that would mean rewriting the code since bash isn't used in the app...
Speaking of the graphical side, maybe we could integrate as part of the footbag dictionary app I developed? I have plans to add more to the app so it is not just a dictionary but a journal/goal tracking app. Additionally, I have a bunch of notes on etymology of different tricks/concepts I will add, and this calculator would also fit nicely in it...but I suppose that would mean rewriting the code since bash isn't used in the app...
TJ Boutorwick
"You can do anything" -Greg Nelson
"You can do anything" -Greg Nelson
Re: freestyle overall calculator
Sure, let's do it. Spreadsheet-like GUI is what comes to my mind. Either player classification based or event classification based. For later stages maybe also config with user adjustable scoring.
Code is not complicated - just for loop, switch case, while loop and some addition and multiplication. It just uses some shell-specific concepts like positional parameters shift, but array should also do the trick. Rewriting should not be an issue. I definitely could help you with that. But I don't have much experience - it just a hobby for me, so I don't know if I could help you with anything more. But I'm open to new knowledge, so if you decide to do it just email me: jmosciszewski@gmail.com
Code is not complicated - just for loop, switch case, while loop and some addition and multiplication. It just uses some shell-specific concepts like positional parameters shift, but array should also do the trick. Rewriting should not be an issue. I definitely could help you with that. But I don't have much experience - it just a hobby for me, so I don't know if I could help you with anything more. But I'm open to new knowledge, so if you decide to do it just email me: jmosciszewski@gmail.com
Jakub Mościszewski
Re: freestyle overall calculator
Ok sweet, sounds good. I'll contact you sometime in the near future.
TJ Boutorwick
"You can do anything" -Greg Nelson
"You can do anything" -Greg Nelson