Created
September 14, 2019 13:04
-
-
Save roblogic/1e255d89611a5d5e7125b949aa7ac807 to your computer and use it in GitHub Desktop.
Olympic scoring routine https://codegolf.stackexchange.com/a/192825/15940
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setopt FORCE_FLOAT | |
| m=$1 n=$1 a=$# | |
| for x ((t+=x))&&m=$[x>m?x:m]&&n=$[x<n?x:n] | |
| s=$[2*(a>2?(t-m-n)/(a-2):t/a)] | |
| <<<$[(s^0+(s-s^0>.5?1:0))/2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment