Skip to content

This program answers any “Yes” or “No” question with a different random fortune each time it executes. It is inspired in the Magic 8-Ball, a popular toy developed in the 1950s for fortune-telling or advice seeking.

Notifications You must be signed in to change notification settings

candytale55/Magic-8-Ball-Python3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Magic-8-Ball-Python3

This program answers any “Yes” or “No” question with a different random fortune each time it executes. It is inspired in the Magic 8-Ball, a popular toy developed in the 1950s for fortune-telling or advice seeking.

General info

magic8_elifs.py answers any “Yes” or “No” question with a different random fortune each time it executes using randint and an if/elif/else control flow.

Features

  • The Magic 8-Ball will give at least these 9 answers:

    • Yes - definitely.
    • It is decidedly so.
    • Without a doubt.
    • Reply hazy, try again.
    • Ask again later.
    • Better not tell you now.
    • My sources say no.
    • Outlook not so good.
    • Very doubtful.
  • The output of the program will have this form:

    [Name] asks: [Question]

    Magic 8-Ball’s answer: [Answer]

    If the the value of name is an empty string it should print out just the question, like this:

    [Question]

    Magic 8-Ball’s answer: [Answer]

  • If the user does not provide any question, then the Magic 8-Ball cannot provide a fortune

To-do list:

  • elifs means the randint range must be manually fixed everytime a new answer is included to the elifs flow. Change it to a list and use the list lenght to automatically update the range of random.

  • The name and question variables are hard coded. Include input() to request the information to the user.

Technologies

  • Python 3

Setup

NA - It's only coding examples, there's no setup.

Status

Project is: technically finished but I will probably come back and do the stuff in the to-do-list.

References

Project based on Codecademy Magic 8-Ball project from Learn Python 3 course

More info about Magic 8-balls: https://en.wikipedia.org/wiki/Magic_8-Ball and in Spanish too: https://es.wikipedia.org/wiki/Magic_8-Ball .

It's cool, the real life Magic 8-balls are or were made with a cylindrical reservoir that contains a white plastic icosahedron die floating in ~100mL of alcohol dyed dark blue.

About

This program answers any “Yes” or “No” question with a different random fortune each time it executes. It is inspired in the Magic 8-Ball, a popular toy developed in the 1950s for fortune-telling or advice seeking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages