Help us understand the problem. What is going on with this article?

pythonでスゴロクゲームと足し算ゲーム

同じ変数への代入等あり

テキストにあった内容を使ってpythonの挙動確認と備忘録

30までの交互スゴロクゲーム

pl_pos = 1
com_pos = 1

while True:

    input("enter-playerが動く")
    pl_pos = pl_pos + random.randint(1,6)

    if pl_pos>30:
        pl_pos = 30

    banmen()

    if pl_pos ==30:
        print("plのかち")
        break

    input("enter-comが動く")
    com_pos = com_pos + random.randint(1,6)

    if com_pos>30:
        com_pos = 30

    banmen()

    if com_pos ==30:
        print("comのかち")
        break

足し算ゲーム

A = random.randint(1,100)
B = random.randint(1,100)

correct = A + B

ans = input("A = "+ str(A) + " B = "+str(B) +" A+Bの合計は?")
if ans == str(correct):
    print("正解")
else:
    print("違います" + str(correct) +"です")

以上

Pythonでつくる ゲーム開発 入門講座より

Ringa_hyj
R,python,分析,ML engineer,社内コンサル。 元:生命科学(創薬有機) 元:製品開発・実験計画 現在:製造業のデータ分析活用 概念検証(需要予測,異常検知,etc.) https://amazongodman.github.io/
https://sit-jhonny.hatenablog.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした