Last active
January 4, 2023 09:03
-
-
Save akionsight/f4a531fbc89b55e18b2814f32e4da058 to your computer and use it in GitHub Desktop.
the most accurate software-based 8 ball ever, play it
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
import random | |
import hashlib | |
import time | |
def main(): | |
choices = ['As I see it, yes.', 'Ask again later.', ' Better not tell you now.', ' Cannot predict now.', 'Concentrate and ask again.', 'Don’t count on it.', 'It is certain.', ' It is decidedly so.', ' Most likely.', 'My reply is no.', 'My sources say no.', 'Outlook not so good.', ' Outlook good.', 'Reply hazy, try again.', 'Signs point to yes.', ' Very doubtful.', ' Without a doubt.', ' Yes.', 'Yes – definitely.', 'You may rely on it.'] | |
question = input('Enter your question: ') | |
hash_question_object = hashlib.sha256(question.encode()) | |
hex_digest = hash_question_object.hexdigest() | |
random.seed(hashlib.sha512(hex_digest.encode()).hexdigest() + str(time.time())) | |
random.shuffle(choices) | |
print(random.choice(choices)) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Noice! 👍