A popular toy developed in the 1950s for fortune-telling or advice seeking.
By generating random numbers and utilizing flow control, this Python program can answer any “Yes” or “No” question with a different fortune each time it executes.
This Magic 8-Ball has 10 possible answers:
The output of the program will have the following format:
- [Name] asks: [Question]
- Magic 8-Ball's answer: [Answer]
For example:
- Dr Watson asks: Will we solve this crime?
- Sherlock Holmes' answers: Without a doubt!
The program is able to provide an alternative output if the asker does not provide a name and/or ask a question