0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Magic 8 Ball] あなたの問いに助言をしてくれるプログラムの実装!!!(超簡単)

Last updated at Posted at 2023-02-12

目的

Magic 8 BallのロジックをPythonで実現してみよう!

Magic 8 Ballとは?

アメリカで流行ったある問いに対して助言をしてくれるボールの玩具のことですね。

実装してみよう

magic_8_ball.py
import random

responses = [
    "It is certain",
    "It is decidedly so",
    "Without a doubt",
    "Yes – definitely",
    "You may rely on it",
    "As I see it, yes",
    "Most likely",
    "Outlook good",
    "Yes",
    "Signs point to yes",
    "Reply hazy, try again",
    "Ask again later",
    "Better not tell you now",
    "Cannot predict now",
    "Concentrate and ask again",
    "Don't count on it",
    "My reply is no",
    "My sources say no",
    "Outlook not so good",
    "Very doubtful",
]

question = input("What is your question? ")
print("Thinking...")
print(random.choice(responses))

何か悩み事があれば、この子に話を聞いてもらいましょう🐰

参考

アメリカでは定番、占い玩具「マジック8ボール」の中身とは?🎱

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?