Last active
July 21, 2022 15:50
-
-
Save matheusinacio7/026b206633f1e4f454cbe4bef55da232 to your computer and use it in GitHub Desktop.
Oracle: always choose the best option when you're uncertain
This file contains 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
# This program decides the best option | |
# when you're uncertain, | |
# with 100% accuracy | |
# Requires python3 to be installed and I've only tested it with zsh, but maybe works with bash as well | |
# drop this in your .zshrc file and run it like: | |
# oracle thai japanese sandwich | |
# to decide what to eat | |
# Takes an arbitrary number of arguments (depends on the maximum for your shell), will pick between them | |
oracle() { | |
arr="" | |
for arg | |
do arr+="'$arg', " | |
done | |
python3 -c "print(__import__('random').choice([$arr]))" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment