And then I colorized it.
This commit is contained in:
parent
6fe35a5047
commit
eabdb77797
2
LICENSE
2
LICENSE
|
|
@ -219,7 +219,7 @@ If you develop a new program, and you want it to be of the greatest possible use
|
|||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
PyF8-Ball
|
||||
Pythonic Fate Ball
|
||||
Copyright (C) 2023 CSnap
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
|
|
|||
|
|
@ -3,5 +3,8 @@
|
|||
Let python decide your fate via 8-Ball logic!
|
||||
|
||||
Call the script with a question. Get an answer.
|
||||
```
|
||||
./f8ball.py "Question?"
|
||||
```
|
||||
|
||||
Results may vary. No warranty or guarantee of any kind is implied.
|
||||
*Results may vary. No warranty or guarantee of any kind is implied.*
|
||||
|
|
|
|||
11
f8ball.py
11
f8ball.py
|
|
@ -1,8 +1,11 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from colorama import Fore, Style, init
|
||||
import random
|
||||
import sys
|
||||
|
||||
init(autoreset=True)
|
||||
|
||||
def magic_fate_ball():
|
||||
# Define possible responses
|
||||
responses = [
|
||||
|
|
@ -23,9 +26,13 @@ def magic_fate_ball():
|
|||
"This is The Way."
|
||||
]
|
||||
|
||||
# Display a random response
|
||||
# Choose a random color for each response
|
||||
response_colors = [Fore.RED, Fore.GREEN, Fore.YELLOW, Fore.CYAN, Fore.MAGENTA, Fore.BLUE, Fore.WHITE]
|
||||
|
||||
# Display a random response with a random color
|
||||
response = random.choice(responses)
|
||||
print(f"The Pythonic Fate Ball says: {response}")
|
||||
response_color = random.choice(response_colors)
|
||||
print(f"The Pythonic Fate Ball says: {response_color}{response}{Style.RESET_ALL}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
magic_fate_ball()
|
||||
|
|
|
|||
Loading…
Reference in New Issue